From d47cae142728a614f61ce51a649af36b34db6f04 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Mon, 3 Jun 2024 11:31:54 -0300 Subject: [PATCH] Use ConfigParser instead of SafeConfigParser The configparser's SafeConfigParser has been renamed to ConfigParser in Python 3.2 [1]. It was finally removed in Python 3.12 [2]. [1] https://docs.python.org/dev/whatsnew/3.2.html#configparser [2] https://docs.python.org/3/whatsnew/3.12.html#configparser --- versioneer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioneer.py b/versioneer.py index a5e7a20..886455f 100644 --- a/versioneer.py +++ b/versioneer.py @@ -340,9 +340,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, "r") as f: - parser.readfp(f) + parser.read_file(f) VCS = parser.get("versioneer", "VCS") # mandatory def get(parser, name):