diff options
author | Barry Warsaw <barry@python.org> | 2005-08-15 18:14:19 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2005-08-15 18:14:19 (GMT) |
commit | e2eca0b709451e6956d7c84658e9c29037be7c0c (patch) | |
tree | b83904c9a8949bd1349dc8cb1888a6a9471dd96f /Python/ceval.c | |
parent | f09582eeda07aafba4f6169acec336927972d89b (diff) | |
download | cpython-e2eca0b709451e6956d7c84658e9c29037be7c0c.zip cpython-e2eca0b709451e6956d7c84658e9c29037be7c0c.tar.gz cpython-e2eca0b709451e6956d7c84658e9c29037be7c0c.tar.bz2 |
Port from the Python 2.4 branch, patches for SF bug # 900092,
hotshot.stats.load.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index d311537..ee3c7bb 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2480,14 +2480,20 @@ fast_block_end: fast_yield: if (tstate->use_tracing) { - if (tstate->c_tracefunc - && (why == WHY_RETURN || why == WHY_YIELD)) { - if (call_trace(tstate->c_tracefunc, - tstate->c_traceobj, f, - PyTrace_RETURN, retval)) { - Py_XDECREF(retval); - retval = NULL; - why = WHY_EXCEPTION; + if (tstate->c_tracefunc) { + if (why == WHY_RETURN || why == WHY_YIELD) { + if (call_trace(tstate->c_tracefunc, + tstate->c_traceobj, f, + PyTrace_RETURN, retval)) { + Py_XDECREF(retval); + retval = NULL; + why = WHY_EXCEPTION; + } + } + else if (why == WHY_EXCEPTION) { + call_trace_protected(tstate->c_tracefunc, + tstate->c_traceobj, f, + PyTrace_RETURN); } } if (tstate->c_profilefunc) { |