summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 4196381..c64a356 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -392,8 +392,8 @@ gettmarg(PyObject *args, struct tm *p)
if (y < 1900) {
PyObject *accept = PyDict_GetItemString(moddict,
"accept2dyear");
- if (accept == NULL || !PyInt_CheckExact(accept) ||
- PyLong_AsLong(accept) == 0) {
+ if (accept == NULL || !PyLong_CheckExact(accept) ||
+ !PyObject_IsTrue(accept)) {
PyErr_SetString(PyExc_ValueError,
"year >= 1900 required");
return 0;