]> granicus.if.org Git - python/commitdiff
Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcname
authorGuido van Rossum <guido@python.org>
Mon, 11 Oct 1999 14:03:12 +0000 (14:03 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 11 Oct 1999 14:03:12 +0000 (14:03 +0000)
object is DECREFed too early.

Objects/classobject.c

index 305c07e494432f8c9a74c6700315463fbc96b9dd..6d49228f479718fae2a5bfa23a526de12f32f4c7 100644 (file)
@@ -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, "<method %.60s.%.60s of %.60s instance at %lx>",
                        fcname, fname, icname, (long)self);
        }
+       Py_XDECREF(funcname);
        return PyString_FromString(buf);
 }