bpo-37151: use PyVectorcall_Call for all calls of "method" (GH-13972)
This commit is contained in:
parent
a514f782b8
commit
c78fe320db
@ -329,17 +329,6 @@ method_traverse(PyMethodObject *im, visitproc visit, void *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
method_call(PyObject *method, PyObject *args, PyObject *kwargs)
|
|
||||||
{
|
|
||||||
PyObject *self, *func;
|
|
||||||
|
|
||||||
self = PyMethod_GET_SELF(method);
|
|
||||||
func = PyMethod_GET_FUNCTION(method);
|
|
||||||
|
|
||||||
return _PyObject_Call_Prepend(func, self, args, kwargs);
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
method_descr_get(PyObject *meth, PyObject *obj, PyObject *cls)
|
method_descr_get(PyObject *meth, PyObject *obj, PyObject *cls)
|
||||||
{
|
{
|
||||||
@ -362,7 +351,7 @@ PyTypeObject PyMethod_Type = {
|
|||||||
0, /* tp_as_sequence */
|
0, /* tp_as_sequence */
|
||||||
0, /* tp_as_mapping */
|
0, /* tp_as_mapping */
|
||||||
(hashfunc)method_hash, /* tp_hash */
|
(hashfunc)method_hash, /* tp_hash */
|
||||||
method_call, /* tp_call */
|
PyVectorcall_Call, /* tp_call */
|
||||||
0, /* tp_str */
|
0, /* tp_str */
|
||||||
method_getattro, /* tp_getattro */
|
method_getattro, /* tp_getattro */
|
||||||
PyObject_GenericSetAttr, /* tp_setattro */
|
PyObject_GenericSetAttr, /* tp_setattro */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user