From cb1835333fbf045ae84b64ef4a84ed39957569cb Mon Sep 17 00:00:00 2001 From: Neil Girdhar Date: Mon, 9 Oct 2023 19:27:27 -0400 Subject: [PATCH] Fix for Python 3.12 Several names deprecated in the configparser way back in 3.2 have been removed per gh-89336: * configparser no longer has a SafeConfigParser class. Use the shorter ConfigParser name instead. * configparser.ConfigParser no longer has a readfp method. Use read_file() instead. --- versioneer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioneer.py b/versioneer.py index 410b14b5a..5df328710 100644 --- a/versioneer.py +++ b/versioneer.py @@ -342,9 +342,9 @@ def get_config_from_root(root): # configparser.NoOptionError (if it lacks "VCS="). See the docstring at # the top of versioneer.py for instructions on writing your setup.cfg . setup_cfg = os.path.join(root, "setup.cfg") - parser = configparser.SafeConfigParser() + parser = configparser.ConfigParser() with open(setup_cfg) as f: - parser.readfp(f) + parser.read_file(f) VCS = parser.get("versioneer", "VCS") # mandatory def get(parser, name):