summaryrefslogtreecommitdiff
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-09-08 16:26:33 +0000
committerBarry Warsaw <barry@python.org>1999-09-08 16:26:33 +0000
commit82408ddc8690438fcdea402c0a4d8f1be736c834 (patch)
tree0a23bf2b99bf8510e6d5670e1e21d8f626112705 /Python/ceval.c
parentd29091a20b00e8bc9bc033733a714e41109746c9 (diff)
downloadcpython-82408ddc8690438fcdea402c0a4d8f1be736c834.tar.gz
call_trace(): A fix for PR#73, if an exception occurred in the
tracefunc (or profilefunc -- we're not sure which), zap the global trace and profile funcs so that we can't get into recursive loop when instantiating the resulting class based exception.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 1c51ccf135..4c1bf2f8b4 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2201,6 +2201,14 @@ call_trace(p_trace, p_newtrace, f, msg, arg)
Py_XDECREF(*p_newtrace);
*p_newtrace = NULL;
}
+ /* to be extra double plus sure we don't get recursive
+ * calls inf either tracefunc or profilefunc gets an
+ * exception, zap the global variables.
+ */
+ Py_XDECREF(tstate->sys_tracefunc);
+ tstate->sys_tracefunc = NULL;
+ Py_XDECREF(tstate->sys_profilefunc);
+ tstate->sys_profilefunc = NULL;
return -1;
}
else {