Commits

Brett Cannon committed 7f1f9e1

Fix a refleak introduced by r66677.

Fix suggested by Amaury Forgeot d'Arc.
Closes issue #4003.

  • Participants
  • Parent commits 6765946
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Modules/_lsprof.c

 	}
 	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;