# HG changeset patch # User Dennis Fink # Date 2015-07-08 22:22:34 # Node ID 3420f682cc1dae9feb4dba34623e13940626bc06 # Parent f643ffc5d90b56a3004581e0641154c383044759 use with statemant for loading the default_json_file diff --git a/spaceapi/active.py b/spaceapi/active.py --- a/spaceapi/active.py +++ b/spaceapi/active.py @@ -20,7 +20,8 @@ def reload_json(): global default_json global active_json - default_json = json.load(open(default_json_file, encoding='utf-8')) + with open(default_json_file, encoding='utf-8') as f: + default_json = json.load(f) if os.path.exists(last_state_file): with open(last_state_file, encoding='utf-8') as f: