Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 982f534 commit 2201ecbCopy full SHA for 2201ecb
1 file changed
Modules/timemodule.c
@@ -504,7 +504,7 @@ time_strftime(PyObject *self, PyObject *args)
504
fmt = PyBytes_AS_STRING(format);
505
#endif
506
507
-#if defined(MS_WINDOWS)
+#if defined(MS_WINDOWS) && !defined(HAVE_WCSFTIME)
508
/* check that the format string contains only valid directives */
509
for(outbuf = strchr(fmt, '%');
510
outbuf != NULL;
@@ -516,7 +516,8 @@ time_strftime(PyObject *self, PyObject *args)
516
!strchr("aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1]))
517
{
518
PyErr_SetString(PyExc_ValueError, "Invalid format string");
519
- return 0;
+ Py_DECREF(format);
520
+ return NULL;
521
}
522
523
0 commit comments