summaryrefslogtreecommitdiff
path: root/Modules/_lsprof.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-09-30 17:46:03 +0000
committerBrett Cannon <bcannon@gmail.com>2008-09-30 17:46:03 +0000
commit507a5f7182afa866485cc28f01a254b98d951ef1 (patch)
treebc6c180fa0c1fcd89e83e128d8df2e61d7a1e025 /Modules/_lsprof.c
parentc48b5e1e2bc32b459f205531d559a22baadb36b0 (diff)
downloadcpython-507a5f7182afa866485cc28f01a254b98d951ef1.tar.gz
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 41c477e388..14bb8f93e8 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;