summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-06-25 00:34:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-06-25 00:34:13 (GMT)
commitd7a034bd7553719e554beea1746079ba72333015 (patch)
tree721a7613e7931801e74a176bdb3267d4eb343443
parent7e00151e1f373a5032bea361f8110b4fa264a493 (diff)
parent36b82d85a32e474117297a9c169b67b4408e3096 (diff)
downloadcpython-d7a034bd7553719e554beea1746079ba72333015.zip
cpython-d7a034bd7553719e554beea1746079ba72333015.tar.gz
cpython-d7a034bd7553719e554beea1746079ba72333015.tar.bz2
(Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999
time.strtime("%Y") returned "2345" when formatting year 12345.
-rw-r--r--Modules/timemodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 429215f..4b526d4 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -598,7 +598,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]");