|
|
@@ -502,11 +502,13 @@ def write_config_file(config: Dict[str, str], out_dir: str=None) -> ConfigDict:
|
|
|
key.upper(): CONFIG.get(key.upper())
|
|
|
for key in config.keys()
|
|
|
}
|
|
|
- except BaseException:
|
|
|
+ except BaseException: # lgtm [py/catch-base-exception]
|
|
|
# something went horribly wrong, rever to the previous version
|
|
|
with open(f'{config_path}.bak', 'r', encoding='utf-8') as old:
|
|
|
atomic_write(config_path, old.read())
|
|
|
|
|
|
+ raise
|
|
|
+
|
|
|
if Path(f'{config_path}.bak').exists():
|
|
|
os.remove(f'{config_path}.bak')
|
|
|
|