catch NoSectionError in simple_config
authorThomasV <thomasv@gitorious>
Fri, 12 Oct 2012 19:31:30 +0000 (21:31 +0200)
committerThomasV <thomasv@gitorious>
Fri, 12 Oct 2012 19:31:30 +0000 (21:31 +0200)
lib/simple_config.py

index f382969..90686af 100644 (file)
@@ -130,8 +130,11 @@ class SimpleConfig:
                 
             p = ConfigParser.ConfigParser()
             p.read(name)
-            for k, v in p.items('client'):
-                self.system_config[k] = v
+            try:
+                for k, v in p.items('client'):
+                    self.system_config[k] = v
+            except ConfigParser.NoSectionError:
+                pass
 
 
     def read_user_config(self):
@@ -145,8 +148,11 @@ class SimpleConfig:
                 
             p = ConfigParser.ConfigParser()
             p.read(name)
-            for k, v in p.items('client'):
-                self.user_config[k] = v
+            try:
+                for k, v in p.items('client'):
+                    self.user_config[k] = v
+            except ConfigParser.NoSectionError:
+                pass
 
 
     def init_path(self, wallet_path):