Fix a refleak introduced by r66678 (backport of r66700).
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 630b043..3f23512 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -150,16 +150,7 @@
}
Py_DECREF(o);
if (PyErr_Occurred()) {
- PyObject *context = (PyObject *)pObj;
- /* May have been called by profiler_dealloc(). */
- if (context->ob_refcnt < 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;