From 196a530e00d88a138973bf9182e013937e293f97 Mon Sep 17 00:00:00 2001 From: Jeroen Demeyer Date: Thu, 4 Jul 2019 12:31:34 +0200 Subject: bpo-37483: add _PyObject_CallOneArg() function (#14558) --- Python/bltinmodule.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 90fbb44882b..5de43636d96 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -29,7 +29,6 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) { Py_ssize_t i, j; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; - PyObject *stack[1] = {bases}; assert(PyTuple_Check(bases)); for (i = 0; i < nargs; i++) { @@ -55,7 +54,7 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) } continue; } - new_base = _PyObject_FastCall(meth, stack, 1); + new_base = _PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; @@ -574,7 +573,7 @@ filter_next(filterobject *lz) ok = PyObject_IsTrue(item); } else { PyObject *good; - good = PyObject_CallFunctionObjArgs(lz->func, item, NULL); + good = _PyObject_CallOneArg(lz->func, item); if (good == NULL) { Py_DECREF(item); return NULL; @@ -1625,7 +1624,7 @@ min_max(PyObject *args, PyObject *kwds, int op) while (( item = PyIter_Next(it) )) { /* get the value from the key function */ if (keyfunc != NULL) { - val = PyObject_CallFunctionObjArgs(keyfunc, item, NULL); + val = _PyObject_CallOneArg(keyfunc, item); if (val == NULL) goto Fail_it_item; } @@ -2178,7 +2177,7 @@ builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits) if (ndigits == NULL || ndigits == Py_None) result = _PyObject_CallNoArg(round); else - result = PyObject_CallFunctionObjArgs(round, ndigits, NULL); + result = _PyObject_CallOneArg(round, ndigits); Py_DECREF(round); return result; } -- cgit v1.2.3