mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
NULL and no exception set from tp_iternext means StopIteration
This commit is contained in:
parent
9a80fa81b0
commit
0296a56520
2 changed files with 7 additions and 1 deletions
|
@ -1839,7 +1839,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
if (!retval) {
|
||||
/* iter may be exhausted */
|
||||
Py_CLEAR(x);
|
||||
if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
|
||||
if (PyErr_Occurred() &&
|
||||
!PyErr_ExceptionMatches(PyExc_StopIteration)) {
|
||||
/* some other exception */
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue