pyupgrade: Reformat with --py36-plus.
This includes mainly fixes of string literals using f-strings or .format(...), as well as unpacking of list comprehensions.
This commit is contained in:
parent
e27ac0ddbe
commit
9ce7c52a10
78 changed files with 356 additions and 389 deletions
|
@ -72,11 +72,11 @@ except ImportError:
|
|||
except (ImportError, AssertionError):
|
||||
if version is not None:
|
||||
print(
|
||||
"{name}>={version} is not installed.".format(name=module_name, version=version),
|
||||
f"{module_name}>={version} is not installed.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
else:
|
||||
print("{name} is not installed.".format(name=module_name), file=sys.stderr)
|
||||
print(f"{module_name} is not installed.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
check_dependency_manually("zulip")
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import configparser
|
||||
import json
|
||||
from typing import Any, Dict, List, Optional
|
||||
from unittest import TestCase
|
||||
|
||||
import mock
|
||||
from unittest import TestCase, mock
|
||||
|
||||
from zulip_botserver import server
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@ from importlib import import_module
|
|||
from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import Any, Dict
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from zulip_bots.lib import BotHandler
|
||||
from zulip_botserver import server
|
||||
|
|
|
@ -98,7 +98,7 @@ def read_config_file(
|
|||
ignored_sections = parser.sections()[1:]
|
||||
|
||||
if len(ignored_sections) > 0:
|
||||
logging.warning("Sections except the '{}' will be ignored".format(bot_section))
|
||||
logging.warning(f"Sections except the '{bot_section}' will be ignored")
|
||||
|
||||
return bots_config
|
||||
|
||||
|
@ -106,7 +106,7 @@ def read_config_file(
|
|||
def parse_config_file(config_file_path: str) -> configparser.ConfigParser:
|
||||
config_file_path = os.path.abspath(os.path.expanduser(config_file_path))
|
||||
if not os.path.isfile(config_file_path):
|
||||
raise OSError("Could not read config file {}: File not found.".format(config_file_path))
|
||||
raise OSError(f"Could not read config file {config_file_path}: File not found.")
|
||||
parser = configparser.ConfigParser()
|
||||
parser.read(config_file_path)
|
||||
return parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue