diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-01-12 23:58:21 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-01-12 23:58:21 (GMT) |
commit | f343e01c170b3f63eafac4568d905be91b676254 (patch) | |
tree | 1c3aa5615718e7ccc70be59a5fbd72b7497869ae /Modules/itertoolsmodule.c | |
parent | e5e298f8755c475e78f8cfc71ee0ea03c6674406 (diff) | |
download | cpython-f343e01c170b3f63eafac4568d905be91b676254.zip cpython-f343e01c170b3f63eafac4568d905be91b676254.tar.gz cpython-f343e01c170b3f63eafac4568d905be91b676254.tar.bz2 |
Merged revisions 68560 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines
#3720: Interpreter crashes when an evil iterator removes its own next function.
Now the slot is filled with a function that always raises.
Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
........
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r-- | Modules/itertoolsmodule.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 8125dcb..dcf6aba 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -886,7 +886,6 @@ dropwhile_next(dropwhileobject *lz) long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -1031,7 +1030,6 @@ takewhile_next(takewhileobject *lz) if (lz->stop == 1) return NULL; - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) return NULL; @@ -1218,7 +1216,6 @@ islice_next(isliceobject *lz) Py_ssize_t oldnext; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; while (lz->cnt < lz->next) { item = iternext(it); @@ -1229,7 +1226,6 @@ islice_next(isliceobject *lz) } if (lz->stop != -1 && lz->cnt >= lz->stop) return NULL; - assert(PyIter_Check(it)); item = iternext(it); if (item == NULL) return NULL; @@ -1361,7 +1357,6 @@ starmap_next(starmapobject *lz) PyObject *result; PyObject *it = lz->it; - assert(PyIter_Check(it)); args = (*Py_TYPE(it)->tp_iternext)(it); if (args == NULL) return NULL; @@ -2403,7 +2398,6 @@ filterfalse_next(filterfalseobject *lz) long ok; PyObject *(*iternext)(PyObject *); - assert(PyIter_Check(it)); iternext = *Py_TYPE(it)->tp_iternext; for (;;) { item = iternext(it); @@ -2888,7 +2882,6 @@ zip_longest_next(ziplongestobject *lz) Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; @@ -2917,7 +2910,6 @@ zip_longest_next(ziplongestobject *lz) Py_INCREF(lz->fillvalue); item = lz->fillvalue; } else { - assert(PyIter_Check(it)); item = (*Py_TYPE(it)->tp_iternext)(it); if (item == NULL) { lz->numactive -= 1; |