Skip to content

Commit 089c6b4

Browse files
committed
Updates for ConfigParser in python 3.12
SafeConfigParser has been deprecated since Python 3.2 and was removed in Python 3.12 entirely. Per the release notes [1] it is recommended to use the ConfigParser class now. Additionally, the readfp method has been removed in favor of read_file. [1] - https://docs.python.org/3.12/whatsnew/3.12.html#configparser
1 parent 692bbbf commit 089c6b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ workflows:
150150
- "3.8"
151151
- "3.9"
152152
- "3.10"
153+
- "3.11"
154+
- "3.12"
153155
filters:
154156
tags:
155157
ignore: /.*/

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)