summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 282da3e..645480c 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -753,6 +753,8 @@ tuple_iter(PyObject *seq)
PyErr_BadInternalCall();
return NULL;
}
+ if (seq->ob_type->tp_as_sequence->sq_item != tupleitem)
+ return PySeqIter_New(seq);
it = PyObject_GC_New(tupleiterobject, &PyTupleIter_Type);
if (it == NULL)
return NULL;