From: Guido van Rossum Date: Mon, 11 Oct 1999 14:03:12 +0000 (+0000) Subject: Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcname X-Git-Tag: v1.6a1~828 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42636dc64d098ab034980e7c3e2bb2e056db3fb7;p=thirdparty%2FPython%2Fcpython.git Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcname object is DECREFed too early. --- diff --git a/Objects/classobject.c b/Objects/classobject.c index 305c07e49443..6d49228f4797 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -1559,7 +1559,6 @@ instancemethod_repr(a) fname = PyString_AS_STRING(funcname); else fname = "?"; - Py_XDECREF(funcname); if (fclassname != NULL && PyString_Check(fclassname)) fcname = PyString_AsString(fclassname); else @@ -1575,6 +1574,7 @@ instancemethod_repr(a) sprintf(buf, "", fcname, fname, icname, (long)self); } + Py_XDECREF(funcname); return PyString_FromString(buf); }