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

Skip to content

Commit bb75678

Browse files
committed
#14796: fix failure of new calendar test on windows.
1 parent 949d8c9 commit bb75678

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_calendar.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ def test_output_htmlcalendar_encoding_default(self):
353353

354354
def test_yeardatescalendar(self):
355355
def shrink(cal):
356-
return [[[' '.join((d.strftime('%D')
357-
for d in z)) for z in y] for y in x] for x in cal]
356+
return [[[' '.join('{:02d}/{:02d}/{}'.format(
357+
d.month, d.day, str(d.year)[-2:]) for d in z)
358+
for z in y] for y in x] for x in cal]
358359
self.assertEqual(
359360
shrink(calendar.Calendar().yeardatescalendar(2004)),
360361
result_2004_dates

0 commit comments

Comments
 (0)