diff options
author | Raymond Hettinger <python@rcn.com> | 2003-03-01 01:44:32 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-03-01 01:44:32 (GMT) |
commit | 8049dde8d769d261a50bb7dd5706c46a37573a6c (patch) | |
tree | 7abc737d5720308884cbbd39708db3db03cf815e | |
parent | 6f177d434f7176a3bdcd735d139a8ada0d2d6fbc (diff) | |
download | cpython-8049dde8d769d261a50bb7dd5706c46a37573a6c.zip cpython-8049dde8d769d261a50bb7dd5706c46a37573a6c.tar.gz cpython-8049dde8d769d261a50bb7dd5706c46a37573a6c.tar.bz2 |
Removed duplicate test from inner loop.
The PyIter_Check is already performed by PyObject_GetIter.
-rw-r--r-- | Objects/abstract.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index b4fbd32..36c1608 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2182,12 +2182,7 @@ PyObject * PyIter_Next(PyObject *iter) { PyObject *result; - if (!PyIter_Check(iter)) { - PyErr_Format(PyExc_TypeError, - "'%.100s' object is not an iterator", - iter->ob_type->tp_name); - return NULL; - } + assert(PyIter_Check(iter)); result = (*iter->ob_type->tp_iternext)(iter); if (result == NULL && PyErr_Occurred() && |