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

Skip to content

Commit 36b82d8

Browse files
committed
Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999
time.strtime("%Y") returned "2345" when formatting year 12345.
1 parent 6efa965 commit 36b82d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/timemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ time_strftime(PyObject *self, PyObject *args)
588588
else if (!gettmarg(tup, &buf) || !checktm(&buf))
589589
return NULL;
590590

591-
#if defined(_MSC_VER) || defined(sun)
591+
#if defined(_MSC_VER) || defined(sun) || defined(_AIX)
592592
if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
593593
PyErr_SetString(PyExc_ValueError,
594594
"strftime() requires year in [1; 9999]");

0 commit comments

Comments
 (0)