diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-01-13 19:54:31 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-01-13 19:54:31 (GMT) |
commit | 0296a565205651b60a3a5690432beb6f3333a7fc (patch) | |
tree | a0341f20773fab2e74c99a0b328743d29270cb3a /Python/ceval.c | |
parent | 9a80fa81b0195bb744f89565bbc212d39c300942 (diff) | |
download | cpython-0296a565205651b60a3a5690432beb6f3333a7fc.zip cpython-0296a565205651b60a3a5690432beb6f3333a7fc.tar.gz cpython-0296a565205651b60a3a5690432beb6f3333a7fc.tar.bz2 |
NULL and no exception set from tp_iternext means StopIteration
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 134d1ee..98219b0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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; } |