summaryrefslogtreecommitdiff
path: root/searxng_extra/update/update_engine_traits.py
diff options
context:
space:
mode:
Diffstat (limited to 'searxng_extra/update/update_engine_traits.py')
-rwxr-xr-xsearxng_extra/update/update_engine_traits.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searxng_extra/update/update_engine_traits.py b/searxng_extra/update/update_engine_traits.py
index faab198d2..eb4484f62 100755
--- a/searxng_extra/update/update_engine_traits.py
+++ b/searxng_extra/update/update_engine_traits.py
@@ -144,9 +144,9 @@ def write_languages_file(sxng_tag_list):
item = (
sxng_tag,
- sxng_locale.get_language_name().title(),
+ sxng_locale.get_language_name().title(), # type: ignore
sxng_locale.get_territory_name() or '',
- sxng_locale.english_name.split(' (')[0],
+ sxng_locale.english_name.split(' (')[0] if sxng_locale.english_name else '',
UnicodeEscape(flag),
)
@@ -154,7 +154,7 @@ def write_languages_file(sxng_tag_list):
language_codes = tuple(language_codes)
- with open(languages_file, 'w', encoding='utf-8') as new_file:
+ with languages_file.open('w', encoding='utf-8') as new_file:
file_content = "{header} {language_codes}{footer}".format(
header=languages_file_header,
language_codes=pformat(language_codes, width=120, indent=4)[1:-1],