mirror of https://github.com/python/cpython
Fix for PR#98 (Adrian Eyre) -- in instancemethod_repr, the funcname
object is DECREFed too early.
This commit is contained in:
parent
08a92cb568
commit
42636dc64d
|
@ -1559,7 +1559,6 @@ instancemethod_repr(a)
|
||||||
fname = PyString_AS_STRING(funcname);
|
fname = PyString_AS_STRING(funcname);
|
||||||
else
|
else
|
||||||
fname = "?";
|
fname = "?";
|
||||||
Py_XDECREF(funcname);
|
|
||||||
if (fclassname != NULL && PyString_Check(fclassname))
|
if (fclassname != NULL && PyString_Check(fclassname))
|
||||||
fcname = PyString_AsString(fclassname);
|
fcname = PyString_AsString(fclassname);
|
||||||
else
|
else
|
||||||
|
@ -1575,6 +1574,7 @@ instancemethod_repr(a)
|
||||||
sprintf(buf, "<method %.60s.%.60s of %.60s instance at %lx>",
|
sprintf(buf, "<method %.60s.%.60s of %.60s instance at %lx>",
|
||||||
fcname, fname, icname, (long)self);
|
fcname, fname, icname, (long)self);
|
||||||
}
|
}
|
||||||
|
Py_XDECREF(funcname);
|
||||||
return PyString_FromString(buf);
|
return PyString_FromString(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue