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:
parent
01b56919ca
commit
d9a120a2c6
|
@ -391,20 +391,17 @@ 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)
|
if db.db_name in self.supported_databases:
|
||||||
except:
|
raise FpdbError("Database names must be unique")
|
||||||
raise FpdbError("Unable to create database object")
|
# If there is only one Database node, or none are marked
|
||||||
else:
|
# default, use first
|
||||||
if db.db_name in self.supported_databases:
|
# default, use first
|
||||||
raise FpdbError("Database names must be unique")
|
if not self.supported_databases:
|
||||||
# If there is only one Database node, or none are marked
|
self.db_selected = db.db_name
|
||||||
# default, use first
|
self.supported_databases[db.db_name] = db
|
||||||
if not self.supported_databases:
|
if db.db_selected:
|
||||||
self.db_selected = db.db_name
|
self.db_selected = db.db_name
|
||||||
self.supported_databases[db.db_name] = db
|
|
||||||
if db.db_selected:
|
|
||||||
self.db_selected = db.db_name
|
|
||||||
|
|
||||||
if dbname and dbname in self.supported_databases:
|
if dbname and dbname in self.supported_databases:
|
||||||
self.db_selected = dbname
|
self.db_selected = dbname
|
||||||
|
|
Loading…
Reference in New Issue
Block a user