Skip to content

Commit

Permalink
time: fix strftime not raising for invalid year values
Browse files Browse the repository at this point in the history
It's crt specific and not compiler specific.
This fixes a test case in test_time
  • Loading branch information
lazka committed Aug 25, 2023
1 parent b77a578 commit e178448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ time_strftime(PyObject *module, PyObject *args)
return NULL;
}

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

0 comments on commit e178448

Please sign in to comment.