diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-06 14:12:19 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-06 14:12:19 -0800 |
commit | 5b4df5813c20fe96f117d0201965b52e86a1a66d (patch) | |
tree | d991f61bc824ca1b1b92bf7fb16fe3dacd4b1335 /Objects/classobject.c | |
parent | 3e0bdff8a0793d305b972f4a653e4698d440b3ae (diff) | |
parent | 95b272b4e0d5438a12702e51e05d03f5a5a8e505 (diff) | |
download | cpython-5b4df5813c20fe96f117d0201965b52e86a1a66d.tar.gz |
Includes ensurepip and venv packages in nuget package.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 5e8ac59df2..b0ed023056 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -302,34 +302,19 @@ method_traverse(PyMethodObject *im, visitproc visit, void *arg) } static PyObject * -method_call(PyObject *func, PyObject *arg, PyObject *kw) +method_call(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *self = PyMethod_GET_SELF(func); - PyObject *result; + PyObject *self, *func; - func = PyMethod_GET_FUNCTION(func); + self = PyMethod_GET_SELF(method); if (self == NULL) { PyErr_BadInternalCall(); return NULL; } - else { - Py_ssize_t argcount = PyTuple_Size(arg); - PyObject *newarg = PyTuple_New(argcount + 1); - int i; - if (newarg == NULL) - return NULL; - Py_INCREF(self); - PyTuple_SET_ITEM(newarg, 0, self); - for (i = 0; i < argcount; i++) { - PyObject *v = PyTuple_GET_ITEM(arg, i); - Py_XINCREF(v); - PyTuple_SET_ITEM(newarg, i+1, v); - } - arg = newarg; - } - result = PyObject_Call((PyObject *)func, arg, kw); - Py_DECREF(arg); - return result; + + func = PyMethod_GET_FUNCTION(method); + + return _PyObject_Call_Prepend(func, self, args, kwargs); } static PyObject * |