Check for non-existent files - remove try/except
This commit is contained in:
parent
1c0823bc23
commit
820e981012
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user