summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c14
-rw-r--r--Python/sysmodule.c2
2 files changed, 6 insertions, 10 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 132fb72..99822e8 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2198,14 +2198,9 @@ eval_frame(PyFrameObject *f)
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 */
@@ -2301,8 +2296,7 @@ eval_frame(PyFrameObject *f)
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)) {
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 82d2999..deead3a 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -260,6 +260,8 @@ profile_trampoline(PyObject *self, PyFrameObject *frame,
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);