changeset 164:90abd423fc0c

Fix: Return empty list if section is not found
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 06 Dec 2012 15:04:29 +0100
parents 1c01c061dfb3
children 83ba64c9a51e
files getan/config.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/getan/config.py	Thu Dec 06 14:57:55 2012 +0100
+++ b/getan/config.py	Thu Dec 06 15:04:29 2012 +0100
@@ -59,7 +59,10 @@
         return self.config.get(section, key)
 
     def items(self, section):
-        return self.config.items(section)
+        try:
+            return self.config.items(section)
+        except NoSectionError:
+            return []
 
     def get_keybinding(self):
         return self.keybinding
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)