Don't crash on new-style newyear date tuple (newyear date is from trunk)
svn: r15223
This commit is contained in:
parent
cf6a378e0a
commit
41c810d9ae
@ -139,7 +139,12 @@ class DateDisplay(object):
|
||||
Formats the extra items (calendar, newyear) for a date.
|
||||
"""
|
||||
scal = self.calendar[cal]
|
||||
snewyear = self.newyear[newyear]
|
||||
if isinstance(newyear, int) and newyear <= len(self.newyear):
|
||||
snewyear = self.newyear[newyear]
|
||||
elif isinstance(newyear, (list, tuple)):
|
||||
snewyear = "%s-%s" % (newyear[0], newyear[1])
|
||||
else:
|
||||
snewyear = "Err"
|
||||
retval = ""
|
||||
for item in [scal, snewyear]:
|
||||
if item:
|
||||
|
Loading…
Reference in New Issue
Block a user