Ronny Pfannschmidt avatar Ronny Pfannschmidt committed 7185707

fix pypath for options patch

Comments (0)

Files changed (1)

pypath-for-options

  
          opt = ExtraOptionItem(self, path, default, callback, workspace,
                                notify=notify)
-@@ -352,19 +338,19 @@ class OptionsConfig(BaseConfig):
+@@ -352,19 +338,17 @@ class OptionsConfig(BaseConfig):
              if hasattr(optionsmanager, 'events'):
                  optionsmanager.emit('option_changed', option=option)
  
          try:
 -            with open(filename) as file:
 -                return json.load(file)
+-        except IOError:
+-            return default
+-        except Exception:
 +            with path.open() as fp:
 +                return json.load(fp)
-         except IOError:
-             return default
-         except Exception:
++        except: #XXX: handle corrupt files better
              return default
  
 -    def dump_data(self, filename, data):
          except Exception, e:
              self.svc.log.exception(e)
  
-@@ -373,11 +359,11 @@ class OptionsConfig(BaseConfig):
+@@ -373,11 +357,11 @@ class OptionsConfig(BaseConfig):
          data = {}
          for f in (self.global_path, self.workspace_path):
              try:
                  pass
              except Exception, e:
                  self.svc.log.exception(e)
-@@ -391,7 +377,7 @@ class OptionsConfig(BaseConfig):
+@@ -391,7 +375,7 @@ class OptionsConfig(BaseConfig):
          else:
              f = self.global_path
  
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.