Replace deprecated ConfigParser method
ConfigParser.readfp() -> ConfigParser.read_file()
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user