diff --git a/Objects/abstract.c b/Objects/abstract.c index 1b6c2b42796..9fb56b6b179 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -716,6 +716,7 @@ PyObject_Format(PyObject *obj, PyObject *format_spec) /* And call it. */ result = PyObject_CallFunctionObjArgs(meth, format_spec, NULL); + Py_DECREF(meth); if (result && !PyUnicode_Check(result)) { PyErr_SetString(PyExc_TypeError,