Skip to content

Commit a06fd95

Browse files
authored
fix
1 parent 9e69557 commit a06fd95

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/update.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ def get_translation_mods_translation():
9191
data = {}
9292
for key, value in translation_mods.items():
9393
tmp = {}
94-
for item in value[1]["translations"]:
95-
base_url = value[0].rsplit('/', 1)[0] + "/content/"
96-
try:
97-
tmp_str = urllib.request.urlopen(base_url + item).read()
98-
except:
99-
tmp_str = urllib.request.urlopen((base_url + item).replace("content", "Content").replace("config", "Config")).read()
100-
tmp |= load_vcmi_json(tmp_str)
101-
data[key] = tmp
94+
if "translations" in value[1]:
95+
for item in value[1]["translations"]:
96+
base_url = value[0].rsplit('/', 1)[0] + "/content/"
97+
try:
98+
tmp_str = urllib.request.urlopen(base_url + item).read()
99+
except:
100+
tmp_str = urllib.request.urlopen((base_url + item).replace("content", "Content").replace("config", "Config")).read()
101+
tmp |= load_vcmi_json(tmp_str)
102+
data[key] = tmp
102103
return data
103104

104105
def get_translation_mods_translation_assets():

0 commit comments

Comments
 (0)