summaryrefslogtreecommitdiff
path: root/grc/gui/Preferences.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2016-07-04 12:18:07 +0200
committerSebastian Koslowski <koslowski@kit.edu>2016-07-07 09:06:57 +0200
commit212b890bcbe3bbcd63893d4c1dbd4105e0bcd916 (patch)
tree15f612d72d6027e20275e21634d9061c6ff8979f /grc/gui/Preferences.py
parentcc58cdd730b7e680ded447ee8f8cff305c83ecbb (diff)
grc: handle corrupted grc.conf more gracefully
For some reason ConfigParser throws not only their base error put also AttributeError, so catching this from now on. If this proves ineffective we can always catch Exception. See https://groups.google.com/forum/#users/9gWa-3XRpG8 for an error report.
Diffstat (limited to 'grc/gui/Preferences.py')
-rw-r--r--grc/gui/Preferences.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py
index 5fbdfe927a..d377018eb4 100644
--- a/grc/gui/Preferences.py
+++ b/grc/gui/Preferences.py
@@ -74,7 +74,7 @@ def entry(key, value=None, default=None):
}.get(_type, _config_parser.get)
try:
result = getter('main', key)
- except ConfigParser.Error:
+ except (AttributeError, ConfigParser.Error):
result = _type() if default is None else default
return result
@@ -106,7 +106,7 @@ def get_file_list(key):
try:
files = [value for name, value in _config_parser.items(key)
if name.startswith('%s_' % key)]
- except ConfigParser.Error:
+ except (AttributeError, ConfigParser.Error):
files = []
return files