Check for non-existent files - remove try/except

This commit is contained in:
Sam Manzi 2016-04-30 12:02:30 +10:00
parent 1c0823bc23
commit 820e981012
No known key found for this signature in database
GPG Key ID: F4A16068AE36B402

View File

@ -1127,13 +1127,13 @@ class GedcomInfoDB(object):
self.standard = GedcomDescription("GEDCOM 5.5 standard") self.standard = GedcomDescription("GEDCOM 5.5 standard")
self.standard.set_dest("GEDCOM 5.5") self.standard.set_dest("GEDCOM 5.5")
try:
filepath = os.path.join(DATA_DIR, "gedcom.xml") filepath = os.path.join(DATA_DIR, "gedcom.xml")
if not os.path.exists(filepath):
return
with open(filepath, "rb") as ged_file: with open(filepath, "rb") as ged_file:
parser = GedInfoParser(self) parser = GedInfoParser(self)
parser.parse(ged_file) parser.parse(ged_file)
except:
return
def add_description(self, name, obj): def add_description(self, name, obj):
self.map[name] = obj self.map[name] = obj