Compare commits

...

2 Commits

Author SHA1 Message Date
Dan Albert
34aca41461 More Python 3.9 compat.
(cherry picked from commit 1c31cffe4b)
2021-05-16 20:47:35 -07:00
Dan Albert
7d83131173 Python 3.9 compatibility.
This argument was removed and wasn't needed anyway since the file itself
is already opened UTF-8.

(cherry picked from commit b9822cd5d1)
2021-05-16 20:47:33 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1521,7 +1521,7 @@ def unit_get_expanded_info(country_name: str, unit_type, request_type: str) -> s
default_value = None default_value = None
faction_value = None faction_value = None
with UNITINFOTEXT_PATH.open("r", encoding="utf-8") as fdata: with UNITINFOTEXT_PATH.open("r", encoding="utf-8") as fdata:
data = json.load(fdata, encoding="utf-8") data = json.load(fdata)
type_exists = data.get(original_name) type_exists = data.get(original_name)
if type_exists is not None: if type_exists is not None:
for faction in type_exists: for faction in type_exists:

View File

@@ -31,7 +31,7 @@ class FactionLoader:
for f in files: for f in files:
try: try:
with f.open("r", encoding="utf-8") as fdata: with f.open("r", encoding="utf-8") as fdata:
data = json.load(fdata, encoding="utf-8") data = json.load(fdata)
factions[data["name"]] = Faction.from_json(data) factions[data["name"]] = Faction.from_json(data)
logging.info("Loaded faction : " + str(f)) logging.info("Loaded faction : " + str(f))
except Exception: except Exception: