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 /Objects/listobject.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 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 59674bf..18d3b90 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -925,7 +925,7 @@ islt(PyObject *x, PyObject *y, PyObject *compare) Py_DECREF(args); if (res == NULL) return -1; - if (!PyInt_CheckExact(res)) { + if (!PyLong_CheckExact(res)) { PyErr_Format(PyExc_TypeError, "comparison function must return int, not %.200s", res->ob_type->tp_name); @@ -934,6 +934,10 @@ islt(PyObject *x, PyObject *y, PyObject *compare) } i = PyLong_AsLong(res); Py_DECREF(res); + if (i == -1 && PyErr_Occurred()) { + /* Overflow in long conversion. */ + return -1; + } return i < 0; } |