From 8049dde8d769d261a50bb7dd5706c46a37573a6c Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 1 Mar 2003 01:44:32 +0000 Subject: Removed duplicate test from inner loop. The PyIter_Check is already performed by PyObject_GetIter. --- Objects/abstract.c | 7 +------ 1 file changed, 1 insertion(+), 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() && -- cgit v0.12