]> granicus.if.org Git - python/commitdiff
Inline PyIter_Next() matching what was done for other itertools.
authorRaymond Hettinger <python@rcn.com>
Sun, 16 Aug 2015 21:24:20 +0000 (14:24 -0700)
committerRaymond Hettinger <python@rcn.com>
Sun, 16 Aug 2015 21:24:20 +0000 (14:24 -0700)
Modules/itertoolsmodule.c

index 18d55d8216035e8760abbb7092482d7ca6b6c211..bba0935898d5badc3c1be37581f6cbebd50b0300 100644 (file)
@@ -1860,7 +1860,7 @@ chain_next(chainobject *lz)
             return NULL;                                /* input not iterable */
         }
     }
-    item = PyIter_Next(lz->active);
+    item = (*Py_TYPE(lz->active)->tp_iternext)(lz->active);
     if (item != NULL)
         return item;
     if (PyErr_Occurred()) {
@@ -3434,7 +3434,7 @@ accumulate_next(accumulateobject *lz)
 {
     PyObject *val, *oldtotal, *newtotal;
 
-    val = PyIter_Next(lz->it);
+    val = (*Py_TYPE(lz->it)->tp_iternext)(lz->it);
     if (val == NULL)
         return NULL;