summaryrefslogtreecommitdiffstats
path: root/Modules/_lsprof.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-09-30 17:46:03 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-09-30 17:46:03 (GMT)
commitf40200b21475998b262e2aa0ec5b909ddde34be2 (patch)
treef807f00a9865eb4029a5e0eeed5b72413822dfaa /Modules/_lsprof.c
parentcad8da8abd4a5b63f8089a19af7c6d4e16f12521 (diff)
downloadcpython-f40200b21475998b262e2aa0ec5b909ddde34be2.zip
cpython-f40200b21475998b262e2aa0ec5b909ddde34be2.tar.gz
cpython-f40200b21475998b262e2aa0ec5b909ddde34be2.tar.bz2
Fix a refleak introduced by r66677.
Fix suggested by Amaury Forgeot d'Arc. Closes issue #4003.
Diffstat (limited to 'Modules/_lsprof.c')
-rw-r--r--Modules/_lsprof.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 41c477e..14bb8f9 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -150,16 +150,7 @@ static PY_LONG_LONG CallExternalTimer(ProfilerObject *pObj)
}
Py_DECREF(o);
if (PyErr_Occurred()) {
- PyObject *context = (PyObject *)pObj;
- /* May have been called by profiler_dealloc(). */
- if (Py_REFCNT(context) < 1) {
- context = PyString_FromString("profiler calling an "
- "external timer");
- if (context == NULL) {
- return 0;
- }
- }
- PyErr_WriteUnraisable(context);
+ PyErr_WriteUnraisable(pObj->externalTimer);
return 0;
}
return result;