removed superfluous try ..except clause. Database.__init__() was not doing any sanity checks,

so the try ..except clause was only covering exceptions we are actually interested in
This commit is contained in:
fpdb-mme 2009-11-02 08:48:07 +01:00
parent 01b56919ca
commit d9a120a2c6

View File

@ -391,15 +391,12 @@ class Config:
#TODO: do we want to take all <database> tags or all <database> tags contained in <supported_databases> #TODO: do we want to take all <database> tags or all <database> tags contained in <supported_databases>
# ..this may break stuff for some users. so leave it unchanged for now untill there is a decission # ..this may break stuff for some users. so leave it unchanged for now untill there is a decission
for db_node in doc.getElementsByTagName("database"): for db_node in doc.getElementsByTagName("database"):
try: db = Database(node=db_node)
db = Database(node = db_node)
except:
raise FpdbError("Unable to create database object")
else:
if db.db_name in self.supported_databases: if db.db_name in self.supported_databases:
raise FpdbError("Database names must be unique") raise FpdbError("Database names must be unique")
# If there is only one Database node, or none are marked # If there is only one Database node, or none are marked
# default, use first # default, use first
# default, use first
if not self.supported_databases: if not self.supported_databases:
self.db_selected = db.db_name self.db_selected = db.db_name
self.supported_databases[db.db_name] = db self.supported_databases[db.db_name] = db