From: Raymond Hettinger Date: Sat, 1 Mar 2003 01:44:32 +0000 (+0000) Subject: Removed duplicate test from inner loop. X-Git-Tag: v2.3c1~1637 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8049dde8d769d261a50bb7dd5706c46a37573a6c;p=python Removed duplicate test from inner loop. The PyIter_Check is already performed by PyObject_GetIter. --- diff --git a/Objects/abstract.c b/Objects/abstract.c index b4fbd32a87..36c1608767 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() &&