zulip: Fix deprecation warnings for SafeConfigParser and readfp.

SafeConfigParser has been renamed to ConfigParser and the method
SafeConfigParser.readfp() is now named ConfigParser.read_file().
This commit is contained in:
Eeshan Garg 2021-12-28 19:32:04 -05:00 committed by Tim Abbott
parent 7c3967f777
commit e6dff1b5b6

View file

@ -10,7 +10,7 @@ import time
import traceback import traceback
import types import types
import urllib.parse import urllib.parse
from configparser import SafeConfigParser from configparser import ConfigParser
from typing import ( from typing import (
IO, IO,
Any, Any,
@ -425,9 +425,9 @@ class Client:
config_file = get_default_config_filename() config_file = get_default_config_filename()
if config_file is not None and os.path.exists(config_file): if config_file is not None and os.path.exists(config_file):
config = SafeConfigParser() config = ConfigParser()
with open(config_file) as f: with open(config_file) as f:
config.readfp(f, config_file) config.read_file(f, config_file)
if api_key is None: if api_key is None:
api_key = config.get("api", "key") api_key = config.get("api", "key")
if email is None: if email is None: