Skip to content

Commit 7c8f193

Browse files
authored
Use ConfigParser instead of SafeConfigParser (#208)
The SafeConfigParser class will be renamed to ConfigParser in Python 3.12 [1]. This alias will be removed in future versions.So we can use ConfigParser directly instead. [1] python/cpython#89336 Signed-off-by: Hongxu Jia <[email protected]> Signed-off-by: Hongxu Jia <[email protected]>
1 parent 4c7eb61 commit 7c8f193

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
@@ -339,9 +339,9 @@ def get_config_from_root(root):
339339
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
340340
# the top of versioneer.py for instructions on writing your setup.cfg .
341341
setup_cfg = os.path.join(root, "setup.cfg")
342-
parser = configparser.SafeConfigParser()
342+
parser = configparser.ConfigParser()
343343
with open(setup_cfg, "r") as f:
344-
parser.readfp(f)
344+
parser.read_file(f)
345345
VCS = parser.get("versioneer", "VCS") # mandatory
346346

347347
def get(parser, name):

0 commit comments

Comments
 (0)