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:
parent
68e9450ef0
commit
ec5a0a792b
@ -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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user