]> granicus.if.org Git - python/commitdiff
Issue #10864: limit year to [1; 9999] for strftime() on Solaris
authorVictor Stinner <victor.stinner@haypocalc.com>
Sat, 8 Jan 2011 03:35:36 +0000 (03:35 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sat, 8 Jan 2011 03:35:36 +0000 (03:35 +0000)
Modules/timemodule.c

index 314d8c3a2c29a4735c043224cbeb45988b82975e..2286006113d3eaaeb68e8f19beecd2215f34105e 100644 (file)
@@ -474,7 +474,7 @@ time_strftime(PyObject *self, PyObject *args)
     else if (!gettmarg(tup, &buf) || !checktm(&buf))
         return NULL;
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(sun)
     if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
         PyErr_Format(PyExc_ValueError,
                      "strftime() requires year in [1; 9999]",