mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
merge 3.3 (#27783)
This commit is contained in:
commit
a12d92bec1
2 changed files with 9 additions and 8 deletions
|
@ -801,7 +801,7 @@ static PyObject *
|
|||
methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
methodcallerobject *mc;
|
||||
PyObject *name, *newargs;
|
||||
PyObject *name;
|
||||
|
||||
if (PyTuple_GET_SIZE(args) < 1) {
|
||||
PyErr_SetString(PyExc_TypeError, "methodcaller needs at least "
|
||||
|
@ -814,13 +814,6 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
if (mc == NULL)
|
||||
return NULL;
|
||||
|
||||
newargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
|
||||
if (newargs == NULL) {
|
||||
Py_DECREF(mc);
|
||||
return NULL;
|
||||
}
|
||||
mc->args = newargs;
|
||||
|
||||
name = PyTuple_GET_ITEM(args, 0);
|
||||
Py_INCREF(name);
|
||||
mc->name = name;
|
||||
|
@ -828,6 +821,12 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
Py_XINCREF(kwds);
|
||||
mc->kwds = kwds;
|
||||
|
||||
mc->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
|
||||
if (mc->args == NULL) {
|
||||
Py_DECREF(mc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject_GC_Track(mc);
|
||||
return (PyObject *)mc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue