Skip to content

Commit

Permalink
Replace readfp() with read_file()
Browse files Browse the repository at this point in the history
The readfp() of ConfigParser has been deprecated since
python3.2[1]. Replace it with read_file()

[1]:
https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.readfp

Signed-off-by: Han Han <hhan@redhat.com>
  • Loading branch information
qiankehan authored and psss committed Aug 31, 2023
1 parent 378ed16 commit 2290449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion did/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, config=None, path=None):
# Parse the config from file
try:
log.info("Inspecting config file '{0}'.".format(path))
self.parser.readfp(codecs.open(path, "r", "utf8"))
self.parser.read_file(codecs.open(path, "r", "utf8"))
except IOError as error:
log.debug(error)
Config.parser = None
Expand Down

0 comments on commit 2290449

Please sign in to comment.