Renamed "fh" to "fp" when opening files, following the Python convention.

This commit is contained in:
2023-02-09 00:02:14 +08:00
parent d99f592cff
commit 36f55900c7
4 changed files with 8 additions and 8 deletions

View File

@ -58,8 +58,8 @@ def init_currencies_command(username: str) -> None:
"""Initializes the currencies."""
existing_codes: set[str] = {x.code for x in Currency.query.all()}
with open(data_dir / "currencies.csv") as fh:
data: list[dict[str, str]] = [x for x in csv.DictReader(fh)]
with open(data_dir / "currencies.csv") as fp:
data: list[dict[str, str]] = [x for x in csv.DictReader(fp)]
to_add: list[dict[str, str]] = [x for x in data
if x["code"] not in existing_codes]
if len(to_add) == 0: