Replace deprecated ConfigParser method

ConfigParser.readfp() -> ConfigParser.read_file()
This commit is contained in:
John Helmert
2019-06-06 19:31:42 -05:00
parent 04693560f5
commit de1d06e33c
2 changed files with 2 additions and 2 deletions

View File

@@ -250,7 +250,7 @@ class Config(object):
config = configparser.ConfigParser() config = configparser.ConfigParser()
if os.path.exists(filename): if os.path.exists(filename):
with codecs.open(filename, encoding='utf-8') as fp: with codecs.open(filename, encoding='utf-8') as fp:
config.readfp(fp) config.read_file(fp)
return cls._parse_rtv_file(config) return cls._parse_rtv_file(config)

View File

@@ -399,7 +399,7 @@ class Theme(object):
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.optionxform = six.text_type # Preserve case config.optionxform = six.text_type # Preserve case
with codecs.open(filename, encoding='utf-8') as fp: with codecs.open(filename, encoding='utf-8') as fp:
config.readfp(fp) config.read_file(fp)
except configparser.ParsingError as e: except configparser.ParsingError as e:
raise ConfigError(e.message) raise ConfigError(e.message)