diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-31 04:32:55 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-31 04:32:55 (GMT) |
commit | 1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5 (patch) | |
tree | b35d6a88c4ded09687f9916e4d4c0b03bafde580 /Objects/abstract.c | |
parent | 538d17aa233e99a0652d0c6d482845e8e909b6e0 (diff) | |
download | cpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.zip cpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.tar.gz cpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.tar.bz2 |
Remove checking redundantly for checks of PyInt and PyLong.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 8eb0fea..8d213b2 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1153,14 +1153,13 @@ PyNumber_Index(PyObject *item) PyObject *result = NULL; if (item == NULL) return null_error(); - if (PyInt_Check(item) || PyLong_Check(item)) { + if (PyLong_Check(item)) { Py_INCREF(item); return item; } if (PyIndex_Check(item)) { result = item->ob_type->tp_as_number->nb_index(item); - if (result && - !PyInt_Check(result) && !PyLong_Check(result)) { + if (result && !PyLong_Check(result)) { PyErr_Format(PyExc_TypeError, "__index__ returned non-int " "(type %.200s)", @@ -1270,7 +1269,7 @@ PyNumber_Long(PyObject *o) } if (m && m->nb_long) { /* This should include subclasses of long */ PyObject *res = m->nb_long(o); - if (res && (!PyInt_Check(res) && !PyLong_Check(res))) { + if (res && !PyLong_Check(res)) { PyErr_Format(PyExc_TypeError, "__long__ returned non-long (type %.200s)", res->ob_type->tp_name); |