From a9347ae96cdfc23f11d3b004981ac6e2de96e2e3 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 14 May 2001 23:47:31 +0000 Subject: [PATCH] Catch invalid date exceptions svn: r9 --- gramps/src/Date.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index e93266415..a611a945a 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -61,11 +61,20 @@ class Date: match = Date.fmt.match(text) if match: matches = match.groups() - self.start.set(matches[1]) - self.stop.set(matches[3]) + try: + self.start.set(matches[1]) + except: + pass + try: + self.stop.set(matches[3]) + except: + pass self.range = 1 else: - self.start.set(text) + try: + self.start.set(text) + except: + pass self.range = 0 #-------------------------------------------------------------------- @@ -102,11 +111,20 @@ class Date: match = Date.fmt.match(text) if match: matches = match.groups() - self.start.set(matches[1]) - self.stop.set(matches[3]) + try: + self.start.set(matches[1]) + except: + pass + try: + self.stop.set(matches[3]) + except: + pass self.range = 1 else: - self.start.quick_set(text) + try: + self.start.quick_set(text) + except: + pass self.range = 0 #-------------------------------------------------------------------------