summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-10-11 14:03:12 (GMT)
committerGuido van Rossum <guido@python.org>1999-10-11 14:03:12 (GMT)
commit42636dc64d098ab034980e7c3e2bb2e056db3fb7 (patch)
tree7214a8bd428b6bb2ab23d574461f58090ee788a7 /Objects/classobject.c
parent08a92cb56874537b88a224e9fcd6a3d89a5a703b (diff)
downloadcpython-42636dc64d098ab034980e7c3e2bb2e056db3fb7.zip
cpython-42636dc64d098ab034980e7c3e2bb2e056db3fb7.tar.gz
cpython-42636dc64d098ab034980e7c3e2bb2e056db3fb7.tar.bz2
Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcname
object is DECREFed too early.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 305c07e..6d49228 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, "<method %.60s.%.60s of %.60s instance at %lx>",
fcname, fname, icname, (long)self);
}
+ Py_XDECREF(funcname);
return PyString_FromString(buf);
}