diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-09-22 21:51:42 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-09-22 21:51:42 (GMT) |
commit | 57ab1cdb152bdb223555ca2f46de06e3e26485dd (patch) | |
tree | e8849d8a9720aa774662027fea68c8f462e25d7b /Modules/timemodule.c | |
parent | 3a0f471e5f14a0b49651bcebc15c721c5c82d28b (diff) | |
download | cpython-57ab1cdb152bdb223555ca2f46de06e3e26485dd.zip cpython-57ab1cdb152bdb223555ca2f46de06e3e26485dd.tar.gz cpython-57ab1cdb152bdb223555ca2f46de06e3e26485dd.tar.bz2 |
Issue #25092: Fix datetime.strftime() failure when errno was already set to EINVAL.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 9de3c84..d2caacd 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -653,6 +653,9 @@ time_strftime(PyObject *self, PyObject *args) PyErr_NoMemory(); break; } +#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) + errno = 0; +#endif _Py_BEGIN_SUPPRESS_IPH buflen = format_time(outbuf, i, fmt, &buf); _Py_END_SUPPRESS_IPH |