fix numeric date parser pathological case

This commit is contained in:
Paul Franklin 2015-05-14 00:31:18 -07:00
parent 35a38bc2bd
commit 3d9d9e2851

View File

@ -614,6 +614,8 @@ class DateParser(object):
match = self._numeric.match(text) match = self._numeric.match(text)
if match: if match:
groups = match.groups() groups = match.groups()
if groups == (None, None, None, None, None):
return Date.EMPTY
if self.ymd: if self.ymd:
# '1789' and ymd: incomplete date # '1789' and ymd: incomplete date
if groups[1] is None: if groups[1] is None: