From 1566aa7f43d373b0b1e4fd2557a51c9dc353e72e Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 9 Mar 2009 14:00:19 +0000 Subject: [PATCH] 2792: Dates in sourcereferences in person_ref_list not upgraded; hack to be removed in future svn: r12270 --- src/gen/lib/date.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 232a0ba23..6f91ea07a 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -748,8 +748,21 @@ class Date: """ Load from the format created by serialize. """ - (self.calendar, self.modifier, self.quality, - self.dateval, self.text, self.sortval, self.newyear) = data + #FIXME: work around 3.1.0 error: + #2792: Dates in sourcereferences in person_ref_list not upgraded + #Added 2009/03/09 + if len(data) == 7: + # This is correct: + (self.calendar, self.modifier, self.quality, + self.dateval, self.text, self.sortval, self.newyear) = data + elif len(data) == 6: + # This is necessary to fix 3.1.0 bug: + (self.calendar, self.modifier, self.quality, + self.dateval, self.text, self.sortval) = data + self.newyear = 0 + # Remove all except if-part after 3.1.1 + else: + raise DateError("Invalid date to unserialize") return self def copy(self, source):