mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
#2964: fix missing INCREF.
This commit is contained in:
parent
38feaf0fef
commit
c9b0953bda
2 changed files with 5 additions and 1 deletions
|
@ -501,8 +501,10 @@ instancemethod_call(PyObject *self, PyObject *arg, PyObject *kw)
|
|||
static PyObject *
|
||||
instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) {
|
||||
register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr);
|
||||
if (obj == NULL)
|
||||
if (obj == NULL) {
|
||||
Py_INCREF(func);
|
||||
return func;
|
||||
}
|
||||
else
|
||||
return PyMethod_New(func, obj);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue