Little Help with Exceptions and ConfigParser

mwt michaeltaft at
Wed Mar 15 05:55:41 CET 2006

Would something like this be more useful?

def __init__(self, config_file):
        self.fahdata = fahdata.FAHData()
        self.INI = ConfigParser.ConfigParser()
        if os.path.exists(config_file):
            except ConfigParser.Error, err:
                print "Cannot parse configuration file. %s" %err
            except IOError:
                print "Problem opening configuration file. %s" %err
            except Error:
                print "Problem with with configuration file. %s" %err

More information about the Python-list mailing list