Skip to content

Commit d675e2f

Browse files
author
Steven Ayoub
committed
Fix deprecated ConfigParser usage for Python 3 compatibility
- Replaced SafeConfigParser with ConfigParser -Updated readfp() to read_file(), resolving AttributeError in Python 3.2+
1 parent eb80081 commit d675e2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

versioneer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ def get_config_from_root(root):
336336
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
337337
# the top of versioneer.py for instructions on writing your setup.cfg .
338338
setup_cfg = os.path.join(root, "setup.cfg")
339-
parser = configparser.SafeConfigParser()
339+
parser = configparser.ConfigParser()
340340
with open(setup_cfg, "r") as f:
341-
parser.readfp(f)
341+
parser.read_file(f)
342342
VCS = parser.get("versioneer", "VCS") # mandatory
343343

344344
def get(parser, name):

0 commit comments

Comments
 (0)