Skip to content

Commit a9623c4

Browse files
committed
pythongh-120713: test that a 0-padded year with century is guaranteed
1 parent 6ca887e commit a9623c4

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Lib/test/datetimetester.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,16 +1699,7 @@ def test_bool(self):
16991699
def test_strftime_y2k(self):
17001700
for y in (1, 49, 70, 99, 100, 999, 1000, 1970):
17011701
d = self.theclass(y, 1, 1)
1702-
# Issue 13305: For years < 1000, the value is not always
1703-
# padded to 4 digits across platforms. The C standard
1704-
# assumes year >= 1900, so it does not specify the number
1705-
# of digits.
1706-
if d.strftime("%Y") != '%04d' % y:
1707-
# Year 42 returns '42', not padded
1708-
self.assertEqual(d.strftime("%Y"), '%d' % y)
1709-
# '0042' is obtained anyway
1710-
if support.has_strftime_extensions:
1711-
self.assertEqual(d.strftime("%4Y"), '%04d' % y)
1702+
self.assertEqual(d.strftime("%4Y"), '%04d' % y)
17121703

17131704
def test_replace(self):
17141705
cls = self.theclass

0 commit comments

Comments
 (0)