Fixed: config file cache

This commit is contained in:
Wiktor Mazur
2020-03-29 14:13:53 +02:00
parent 5a4465f964
commit 7802454029
+4 -4
View File
@@ -45,10 +45,10 @@ def config():
cfg = toml.load(cfg_file) cfg = toml.load(cfg_file)
if cfg['config']['version'] != CFG_VERSION: if cfg['config']['version'] != CFG_VERSION:
raise Exception('Version changed') raise Exception('Version changed')
return cfg _config = cfg
except(Exception) as e: except(Exception) as _:
with open(conf_file, "w") as cfg_file: with open(conf_file, "w") as cfg_file:
cfg_file.write(default) cfg_file.write(default)
return toml.loads(default) _config = toml.loads(default)
return {} return _config