OSDN Git Service

app: simplify handling of malformed settings.json
authorMartin Renold <martinxyz@gmx.ch>
Sun, 10 Jul 2011 19:43:42 +0000 (21:43 +0200)
committerMartin Renold <martinxyz@gmx.ch>
Sun, 10 Jul 2011 19:43:42 +0000 (21:43 +0200)
Special case for empty file not needed any more.
https://gna.org/bugs/?18314

gui/application.py

index 60eb466..108857b 100644 (file)
@@ -141,10 +141,6 @@ class Application: # singleton
         def get_json_config():
             settingspath = join(self.confpath, 'settings.json')
             jsonstr = open(settingspath).read()
-            if not jsonstr.strip():
-                # happens when we saved it with no space left on device
-                print 'Warning: empty settings.json, using defaults'
-                return {}
             try:
                 return helpers.json_loads(jsonstr)
             except Exception, e: