Skip to content

Commit a412102

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 f724362 commit a412102

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

versioneer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,8 @@ def get_config_from_root(root):
409409
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
410410
# the top of versioneer.py for instructions on writing your setup.cfg .
411411
setup_cfg = os.path.join(root, "setup.cfg")
412-
parser = configparser.SafeConfigParser()
413-
with open(setup_cfg, "r") as f:
414-
parser.readfp(f)
412+
parser = configparser.ConfigParser()
413+
parser.read(setup_cfg)
415414
VCS = parser.get("versioneer", "VCS") # mandatory
416415

417416
def get(parser, name):

0 commit comments

Comments
 (0)