summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-03-01 01:44:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-03-01 01:44:32 (GMT)
commit8049dde8d769d261a50bb7dd5706c46a37573a6c (patch)
tree7abc737d5720308884cbbd39708db3db03cf815e /Objects
parent6f177d434f7176a3bdcd735d139a8ada0d2d6fbc (diff)
downloadcpython-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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c7
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() &&