Skip to content

Commit e178448

Browse files
committed
time: fix strftime not raising for invalid year values
It's crt specific and not compiler specific. This fixes a test case in test_time
1 parent b77a578 commit e178448

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/timemodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ time_strftime(PyObject *module, PyObject *args)
783783
return NULL;
784784
}
785785

786-
#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__)
786+
#if defined(MS_WINDOWS) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__)
787787
if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
788788
PyErr_SetString(PyExc_ValueError,
789789
"strftime() requires year in [1; 9999]");

0 commit comments

Comments
 (0)