f->f_lasti -= 2;
PyTraceBack_Here(f);
- if (tstate->use_tracing) {
- if (tstate->c_tracefunc)
- call_exc_trace(tstate->c_tracefunc,
- tstate->c_traceobj, f);
- if (tstate->c_profilefunc)
- call_exc_trace(tstate->c_profilefunc,
- tstate->c_profileobj,f);
- }
+ if (tstate->c_tracefunc != NULL)
+ call_exc_trace(tstate->c_tracefunc,
+ tstate->c_traceobj, f);
}
/* For the rest, treat WHY_RERAISE as WHY_EXCEPTION */
why = WHY_EXCEPTION;
}
}
- if (tstate->c_profilefunc
- && (why == WHY_RETURN || why == WHY_YIELD)) {
+ if (tstate->c_profilefunc) {
if (call_trace(tstate->c_profilefunc,
tstate->c_profileobj, f,
PyTrace_RETURN, retval)) {
PyThreadState *tstate = frame->f_tstate;
PyObject *result;
+ if (arg == NULL)
+ arg = Py_None;
result = call_trampoline(tstate, self, frame, what, arg);
if (result == NULL) {
PyEval_SetProfile(NULL, NULL);