Skip to content

Commit

Permalink
Update use of Removed ConfigParser.readfp() Function
Browse files Browse the repository at this point in the history
This was replaced with read_file() in version 3.2.
Added a try cactch block around this code so we can delegate through to either version.
  • Loading branch information
c0rp3n authored and dvander committed Nov 11, 2024
1 parent 91397a3 commit 82a8e9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def parse_manifest(path, local_folder, source = {}):

with open(path, 'r') as fp:
cfg = configparser.ConfigParser()
cfg.readfp(fp)
try:
cfg.read_file(fp)
except AttributeError:
cfg.readfp(fp) # Removed as of configparser version 3.2

for section in cfg.sections():
if section not in manifest:
Expand Down

0 comments on commit 82a8e9e

Please sign in to comment.