diff profilemanager/manager.py @ 59:ee2777913a9e

check the correct way to see if the option is there
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 May 2010 12:02:33 -0700
parents ce6a101fb239
children 24782e4c70ca
line wrap: on
line diff
--- a/profilemanager/manager.py	Fri May 07 11:55:15 2010 -0700
+++ b/profilemanager/manager.py	Fri May 07 12:02:33 2010 -0700
@@ -9,6 +9,7 @@
 import ConfigParser
 from random import Random
 from utils import format_tabular
+#from ConfigParser import NoOptionError
 from ConfigParser import SafeConfigParser as ConfigParser
 
 # Changes to profiles.ini:
@@ -313,10 +314,9 @@
         for section in parser.sections():
             if section == 'General':
                 continue
-            try:
-                name = parser.get(section, 'name')
-            except ConfigParser.NoOptionError:
+            if not parser.has_option(section, 'Name'):
                 continue
+            name = parser.get_option(section, 'Name')
             retval[name] = self.profile_dict(name)
         return retval