Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07c57d4

Browse files
author
Skip Montanaro
committed
better solution for bug #533234 courtesy of Tim.
Michael: use this version as the bugfix candidate...
1 parent e8c6a3e commit 07c57d4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/calendar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def __getitem__(self, item):
3333
if item < 0: item += self.len
3434
if not 0 <= item < self.len:
3535
raise IndexError, "out of range"
36-
return strftime(self.format, (item,)*8+(0,)).capitalize()
36+
t = (2001, 1, item+1, 12, 0, 0, item, item+1, 0)
37+
return strftime(self.format, t).capitalize()
3738
elif isinstance(item, type(slice(0))):
3839
return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop)
3940
def __len__(self):

0 commit comments

Comments
 (0)