GH-96864: Check for error between line and opcode events (GH-96880)

(cherry picked from commit c10e33ac11)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
This commit is contained in:
Miss Islington (bot) 2022-09-20 10:49:01 -07:00 committed by GitHub
parent fc1cbe761b
commit 32d80decbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -6933,7 +6933,7 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
}
}
/* Always emit an opcode event if we're tracing all opcodes. */
if (f->f_trace_opcodes) {
if (f->f_trace_opcodes && result == 0) {
result = call_trace(func, obj, tstate, frame, PyTrace_OPCODE, Py_None);
}
return result;