Skip to content

Commit c78fe32

Browse files
jdemeyermethane
authored andcommitted
bpo-37151: use PyVectorcall_Call for all calls of "method" (GH-13972)
1 parent a514f78 commit c78fe32

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

Objects/classobject.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -329,17 +329,6 @@ method_traverse(PyMethodObject *im, visitproc visit, void *arg)
329329
return 0;
330330
}
331331

332-
static PyObject *
333-
method_call(PyObject *method, PyObject *args, PyObject *kwargs)
334-
{
335-
PyObject *self, *func;
336-
337-
self = PyMethod_GET_SELF(method);
338-
func = PyMethod_GET_FUNCTION(method);
339-
340-
return _PyObject_Call_Prepend(func, self, args, kwargs);
341-
}
342-
343332
static PyObject *
344333
method_descr_get(PyObject *meth, PyObject *obj, PyObject *cls)
345334
{
@@ -362,7 +351,7 @@ PyTypeObject PyMethod_Type = {
362351
0, /* tp_as_sequence */
363352
0, /* tp_as_mapping */
364353
(hashfunc)method_hash, /* tp_hash */
365-
method_call, /* tp_call */
354+
PyVectorcall_Call, /* tp_call */
366355
0, /* tp_str */
367356
method_getattro, /* tp_getattro */
368357
PyObject_GenericSetAttr, /* tp_setattro */

0 commit comments

Comments
 (0)