From cc768b3d36aae056a486e6104b2c45f206fe1081 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Fri, 11 Dec 2009 23:09:02 +0000 Subject: [PATCH] Proper default value for lookup_calendar svn: r13769 --- src/gen/lib/date.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 821136705..94ba4b93f 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -688,8 +688,6 @@ class Date(object): raise AttributeError, "invalid args to Date: %s" % source #### ok, process either date or tuple if isinstance(source, tuple): - if calendar is None: - self.calendar = Date.CAL_GREGORIAN self.calendar = lookup_calendar(calendar) if modifier is None: self.modifier = Date.MOD_NONE @@ -1806,6 +1804,7 @@ def lookup_calendar(calendar): >>> lookup_calendar("hebrew") 2 """ + if calendar is None: return Date.CAL_GREGORIAN if isinstance(calendar, int): return calendar for pos, calendar_name in enumerate(Date.calendar_names): if calendar.lower() == calendar_name.lower():