bot_config: Avoid deprecated ConfigParser.readfp method.

Fixes this warning with python -Wd:

/home/circleci/zulip/zerver/lib/bot_config.py:69: DeprecationWarning: This method will be removed in future versions.  Use 'parser.read_file()' instead.
  config.readfp(conf)

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

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-03 18:00:25 -07:00
committed by Tim Abbott
parent 95f29b5409
commit b94b350ff0

View File

@@ -66,7 +66,7 @@ def load_bot_config_template(bot: str) -> Dict[str, str]:
if os.path.isfile(config_path):
config = configparser.ConfigParser()
with open(config_path) as conf:
config.readfp(conf)
config.read_file(conf)
return dict(config.items(bot))
else:
return dict()