summaryrefslogtreecommitdiff
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 23de173962..2133273872 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -467,6 +467,14 @@ time_strftime(PyObject *self, PyObject *args)
return ret;
}
free(outbuf);
+#if defined _MSC_VER && _MSC_VER >= 1400
+ /* VisualStudio .NET 2005 does this properly */
+ if (buflen == 0 && errno == EINVAL) {
+ PyErr_SetString(PyExc_ValueError, "Invalid format string");
+ return 0;
+ }
+#endif
+
}
}