mirror of https://github.com/python/cpython
#2964: fix missing INCREF.
This commit is contained in:
parent
38feaf0fef
commit
c9b0953bda
|
@ -12,6 +12,8 @@ What's new in Python 3.0b1?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #2964: fix a missing INCREF in instancemethod_descr_get.
|
||||||
|
|
||||||
- Issue 2895: Don't crash when given bytes objects as keyword names.
|
- Issue 2895: Don't crash when given bytes objects as keyword names.
|
||||||
|
|
||||||
- Issue 2798: When parsing arguments with PyArg_ParseTuple, the "s" code now
|
- Issue 2798: When parsing arguments with PyArg_ParseTuple, the "s" code now
|
||||||
|
|
|
@ -501,8 +501,10 @@ instancemethod_call(PyObject *self, PyObject *arg, PyObject *kw)
|
||||||
static PyObject *
|
static PyObject *
|
||||||
instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) {
|
instancemethod_descr_get(PyObject *descr, PyObject *obj, PyObject *type) {
|
||||||
register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr);
|
register PyObject *func = PyInstanceMethod_GET_FUNCTION(descr);
|
||||||
if (obj == NULL)
|
if (obj == NULL) {
|
||||||
|
Py_INCREF(func);
|
||||||
return func;
|
return func;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return PyMethod_New(func, obj);
|
return PyMethod_New(func, obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue