summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 8d161d4..2e48007 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -642,6 +642,13 @@ time_strftime(PyObject *self, PyObject *args)
Py_DECREF(format);
return NULL;
}
+ if ((outbuf[1] == 'y') && buf.tm_year < 0)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "format %y requires year >= 1900 on Windows");
+ Py_DECREF(format);
+ return NULL;
+ }
}
#endif