Skip to content

Commit 756c026

Browse files
committed
MNT: change from using SafeConfigParser to ConfigParser
SafeConfigParser has been deprecated since Python 3.2 and will be removed in py311. python/cpython#28292 https://bugs.python.org/issue45173
1 parent aa97d05 commit 756c026

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

versioneer.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,8 @@ def get_config_from_root(root):
396396
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
397397
# the top of versioneer.py for instructions on writing your setup.cfg .
398398
setup_cfg = os.path.join(root, "setup.cfg")
399-
parser = configparser.SafeConfigParser()
400-
with open(setup_cfg, "r") as f:
401-
parser.readfp(f)
399+
parser = configparser.ConfigParser()
400+
parser.read(setup_cfg)
402401
VCS = parser.get("versioneer", "VCS") # mandatory
403402

404403
def get(parser, name):

0 commit comments

Comments
 (0)