Skip to content
Snippets Groups Projects
Commit 6298c72c authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Close pystencils' config file after writing

parent ad26bd81
Branches
Tags
No related merge requests found
Pipeline #17951 passed with stage
in 2 minutes and 41 seconds
......@@ -173,7 +173,8 @@ def read_config():
config = recursive_dict_update(config, loaded_config)
else:
create_folder(config_path, True)
json.dump(config, open(config_path, 'w'), indent=4)
with open(config_path, 'w') as f:
json.dump(config, f, indent=4)
if config['cache']['object_cache'] is not False:
config['cache']['object_cache'] = os.path.expanduser(config['cache']['object_cache']).format(pid=os.getpid())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment