src/GrampsDbUtils/_GedcomLex.py : #2008 fix error in extract_date()

RANGE pattern only returns 4 pattern groups, code was assigning to 5!?
     (see also r10470)


svn: r10471
This commit is contained in:
James G Sack 2008-04-05 06:45:46 +00:00
parent 68e9450ef0
commit ec5a0a792b

View File

@ -269,7 +269,7 @@ def extract_date(text):
# parse the range if we match, if so, return
match = RANGE.match(text)
if match:
(cal1, data1, ignore, cal2, data2) = match.groups()
(cal1, data1, cal2, data2) = match.groups()
cal = CALENDAR_MAP.get(cal1, gen.lib.Date.CAL_GREGORIAN)
@ -309,7 +309,12 @@ def extract_date(text):
dateobj = DATE_CNV.parse(text)
dateobj.set_quality(qual)
return dateobj
# FIXME: explain where/why an IOError might arise
# and also: is such a long try-clause needed
# having this fallback invites "what about other exceptions?"
except IOError:
# fallback strategy (evidently)
return DATE_CNV.set_text(text)
#-------------------------------------------------------------------------