Skip to content
Snippets Groups Projects
Commit d2757579 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'close-config-file-after-writing' into 'master'

Close pystencils' config file after writing

See merge request !51
parents ad26bd81 6298c72c
No related branches found
No related tags found
1 merge request!51Close pystencils' config file after writing
Pipeline #18074 passed with warnings
...@@ -173,7 +173,8 @@ def read_config(): ...@@ -173,7 +173,8 @@ def read_config():
config = recursive_dict_update(config, loaded_config) config = recursive_dict_update(config, loaded_config)
else: else:
create_folder(config_path, True) 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: if config['cache']['object_cache'] is not False:
config['cache']['object_cache'] = os.path.expanduser(config['cache']['object_cache']).format(pid=os.getpid()) config['cache']['object_cache'] = os.path.expanduser(config['cache']['object_cache']).format(pid=os.getpid())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment