diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-04-06 19:04:10 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-04-06 19:04:10 (GMT) |
commit | bb84565cdb243521126137b818c411bef429f86d (patch) | |
tree | d8f6debc319b3f132af8580868b1f94d9ba2b030 /Objects | |
parent | 9c6eb266f5c275a4836f32720f37451c4f14c50d (diff) | |
download | cpython-bb84565cdb243521126137b818c411bef429f86d.zip cpython-bb84565cdb243521126137b818c411bef429f86d.tar.gz cpython-bb84565cdb243521126137b818c411bef429f86d.tar.bz2 |
Issue #14010: Fix a crash when iterating or deleting deeply nested filters
in itertools module (i.e. itertools.izip(), itertools.chain(), etc).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 3c88711..bc247e5 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -3104,7 +3104,10 @@ PyObject * PyIter_Next(PyObject *iter) { PyObject *result; + if (Py_EnterRecursiveCall(" while iterating")) + return NULL; result = (*iter->ob_type->tp_iternext)(iter); + Py_LeaveRecursiveCall(); if (result == NULL && PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) |