diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-12-04 22:10:37 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-12-04 22:10:37 (GMT) |
commit | d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6 (patch) | |
tree | 17489e6ea4df32ba3b3bbda6e4b31155a460f265 /Modules/timemodule.c | |
parent | 0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 (diff) | |
download | cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.zip cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.gz cpython-d1a1d1ed802187cd1a9a8a95ac5d758c7acffee6.tar.bz2 |
Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 4 |
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; |