mirror of https://github.com/python/cpython
Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999
time.strtime("%Y") returned "2345" when formatting year 12345.
This commit is contained in:
parent
6efa965a27
commit
36b82d85a3
|
@ -588,7 +588,7 @@ time_strftime(PyObject *self, PyObject *args)
|
|||
else if (!gettmarg(tup, &buf) || !checktm(&buf))
|
||||
return NULL;
|
||||
|
||||
#if defined(_MSC_VER) || defined(sun)
|
||||
#if defined(_MSC_VER) || defined(sun) || defined(_AIX)
|
||||
if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"strftime() requires year in [1; 9999]");
|
||||
|
|
Loading…
Reference in New Issue