]> granicus.if.org Git - python/commit
Fix several bugs in handling of exceptions with trace function enabled.
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 27 Jun 2003 16:13:17 +0000 (16:13 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 27 Jun 2003 16:13:17 +0000 (16:13 +0000)
commit9263f5797c41dd3c781913ee827992c3686ac8a3
treeb6f82a1e1477fc19ffb81d3ac260088364a0fa1b
parent8f6c7c5d5fc43e4a98eef2c1c584d52127a2ed59
Fix several bugs in handling of exceptions with trace function enabled.

If the callback raised an exception but did not set curexc_traceback,
the trace function was called with PyTrace_RETURN.  That is, the trace
function was called with an exception set.  The main loop detected the
exception when the trace function returned; it complained and disabled
tracing.

Fix the logic error so that PyTrace_RETURN only occurs if the callback
returned normally.

The trace function must be called for exceptions, too.  So we had
to add new functionality to call with PyTrace_EXCEPTION.  (Leads to a
rather ugly ifdef / else block that contains only a '}'.)

Reverse the logic and name of NOFIX_TRACE to FIX_TRACE.

Joint work with Fred.
Modules/pyexpat.c