Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 87318:95eea8624d05
Better behavior when stepping over yield[from]. Fixes issue 16596. By Xavier de Gaye.
| author | Guido van Rossum <guido@dropbox.com> |
|---|---|
| date | Thu, 21 Nov 2013 11:30:06 -0800 |
| parents | cca13dd603a9 |
| children | 8f556ee0f6ba |
line wrap: on
line diff
--- a/Python/ceval.c Thu Nov 21 11:07:45 2013 -0800 +++ b/Python/ceval.c Thu Nov 21 11:30:06 2013 -0800 @@ -1904,6 +1904,9 @@ Py_DECREF(v); if (retval == NULL) { PyObject *val; + if (tstate->c_tracefunc != NULL + && PyErr_ExceptionMatches(PyExc_StopIteration)) + call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f); err = _PyGen_FetchStopIterationValue(&val); if (err < 0) goto error; @@ -2654,6 +2657,8 @@ if (PyErr_Occurred()) { if (!PyErr_ExceptionMatches(PyExc_StopIteration)) goto error; + else if (tstate->c_tracefunc != NULL) + call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f); PyErr_Clear(); } /* iterator ended normally */
