refactor: prefer f-strings to other format/concatentation styles (#8474)

This commit is contained in:
Kevin Kirsche
2022-08-03 08:04:27 -04:00
committed by GitHub
parent 38c4a1ece2
commit bd7a02fad4
5 changed files with 7 additions and 7 deletions

View File

@@ -147,7 +147,7 @@ def parse_versions(fname: StrPath) -> dict[str, tuple[MinVersion, MaxVersion]]:
if line == "":
continue
m = _VERSION_LINE_RE.match(line)
assert m, "invalid VERSIONS line: " + line
assert m, f"invalid VERSIONS line: {line}"
mod: str = m.group(1)
min_version = parse_version(m.group(2))
max_version = parse_version(m.group(3)) if m.group(3) else (99, 99)
@@ -160,7 +160,7 @@ _VERSION_RE = re.compile(r"^([23])\.(\d+)$")
def parse_version(v_str: str) -> tuple[int, int]:
m = _VERSION_RE.match(v_str)
assert m, "invalid version: " + v_str
assert m, f"invalid version: {v_str}"
return int(m.group(1)), int(m.group(2))