From 820e981012d5db3457503c2f590db51858c2702e Mon Sep 17 00:00:00 2001 From: Sam Manzi Date: Sat, 30 Apr 2016 12:02:30 +1000 Subject: [PATCH] Check for non-existent files - remove try/except --- gramps/plugins/lib/libgedcom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 4e35fa56c..4df7b7feb 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -1127,14 +1127,14 @@ class GedcomInfoDB(object): self.standard = GedcomDescription("GEDCOM 5.5 standard") self.standard.set_dest("GEDCOM 5.5") - try: - filepath = os.path.join(DATA_DIR, "gedcom.xml") - with open(filepath, "rb") as ged_file: - parser = GedInfoParser(self) - parser.parse(ged_file) - except: + filepath = os.path.join(DATA_DIR, "gedcom.xml") + if not os.path.exists(filepath): return + with open(filepath, "rb") as ged_file: + parser = GedInfoParser(self) + parser.parse(ged_file) + def add_description(self, name, obj): self.map[name] = obj