diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0e09c97bea09a5..1624a93ec3f3e3 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3375,6 +3375,7 @@ slot_tp_del(PyObject *self) } /* Execute __del__ method, if any. */ del = _PyType_Lookup(Py_TYPE(self), tp_del); + Py_DECREF(tp_del); if (del != NULL) { res = PyObject_CallOneArg(del, self); if (res == NULL)