Changeset - 4972790c9279
[Not reviewed]
default
0 1 0
Dennis Fink - 10 years ago 2015-07-08 22:22:47

also check if last_state_file is a file
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spaceapi/active.py
Show inline comments
 
@@ -20,13 +20,13 @@ def reload_json():
 
    global default_json
 
    global active_json
 

	
 
    with open(default_json_file, encoding='utf-8') as f:
 
        default_json = json.load(f)
 

	
 
    if os.path.exists(last_state_file):
 
    if os.path.exists(last_state_file) and os.path.isfile(last_state_file):
 
        with open(last_state_file, encoding='utf-8') as f:
 
            active_json = json.load(f)
 

	
 
        if os.path.getmtime(last_state_file) \
 
           < os.path.getmtime(default_json_file):
 
            backup = copy.deepcopy(active_json)
0 comments (0 inline, 0 general)