From f037feaebc219ac63d9a92a0ec13b6a580e18a68 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 6 Aug 2020 01:49:52 +0200 Subject: [PATCH] Handle non-existing translations in clean script (#38574) --- script/translations/clean.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/translations/clean.py b/script/translations/clean.py index 1c0178d4c0d..0eabf6214ae 100644 --- a/script/translations/clean.py +++ b/script/translations/clean.py @@ -44,7 +44,10 @@ def find_core(): translations = int_dir / "translations" / "en.json" strings_json = json.loads(strings.read_text()) - translations_json = json.loads(translations.read_text()) + if translations.is_file(): + translations_json = json.loads(translations.read_text()) + else: + translations_json = {} find_extra( strings_json, translations_json, f"component::{int_dir.name}", missing_keys