]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19634: Fix time_strftime() on AIX, format is a wchar_t* not a PyObject*
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 01:43:29 +0000 (02:43 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 18 Nov 2013 01:43:29 +0000 (02:43 +0100)
Modules/timemodule.c

index 32fe6a7c6903e912050dc786ebe8e2ed19fe6b17..ca399069948aabdd60f21b30d5d710be3f9035ff 100644 (file)
@@ -650,7 +650,7 @@ time_strftime(PyObject *self, PyObject *args)
             return NULL;
         }
     }
-#elif defined(_AIX)
+#elif defined(_AIX) && defined(HAVE_WCSFTIME)
     for(outbuf = wcschr(fmt, '%');
         outbuf != NULL;
         outbuf = wcschr(outbuf+2, '%'))
@@ -660,7 +660,6 @@ time_strftime(PyObject *self, PyObject *args)
         if (outbuf[1] == L'y' && buf.tm_year < 0) {
             PyErr_SetString(PyExc_ValueError,
                             "format %y requires year >= 1900 on AIX");
-            Py_DECREF(format);
             return NULL;
         }
     }