commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/04: grc: handle corrupted grc.conf more


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/04: grc: handle corrupted grc.conf more gracefully
Date: Mon, 25 Jul 2016 15:46:06 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 212b890bcbe3bbcd63893d4c1dbd4105e0bcd916
Author: Sebastian Koslowski <address@hidden>
Date:   Mon Jul 4 12:18:07 2016 +0200

    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.
---
 grc/gui/Preferences.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py
index 5fbdfe9..d377018 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]