aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2020-02-11 17:46:57 +0100
committerGitHub <noreply@github.com>2020-02-11 17:46:57 +0100
commitffd9753a944916ced659b2c77aebe66a6c9fbab5 (patch)
treef3469bdca81c102afa811a39dd3eaa9643287e93 /Python/bltinmodule.c
parentbpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397) (diff)
downloadcpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.gz
cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.bz2
cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.zip
bpo-39245: Switch to public API for Vectorcall (GH-18460)
The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 980b81041b4..cb048af9785 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -56,7 +56,7 @@ update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs)
}
continue;
}
- new_base = _PyObject_CallOneArg(meth, bases);
+ new_base = PyObject_CallOneArg(meth, bases);
Py_DECREF(meth);
if (!new_base) {
goto error;
@@ -203,7 +203,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs,
}
else {
PyObject *pargs[2] = {name, bases};
- ns = _PyObject_FastCallDict(prep, pargs, 2, mkw);
+ ns = PyObject_VectorcallDict(prep, pargs, 2, mkw);
Py_DECREF(prep);
}
if (ns == NULL) {
@@ -229,7 +229,7 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs,
}
}
PyObject *margs[3] = {name, bases, ns};
- cls = _PyObject_FastCallDict(meta, margs, 3, mkw);
+ cls = PyObject_VectorcallDict(meta, margs, 3, mkw);
if (cls != NULL && PyType_Check(cls) && PyCell_Check(cell)) {
PyObject *cell_cls = PyCell_GET(cell);
if (cell_cls != cls) {
@@ -489,7 +489,7 @@ builtin_breakpoint(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
}
Py_INCREF(hook);
- PyObject *retval = _PyObject_Vectorcall(hook, args, nargs, keywords);
+ PyObject *retval = PyObject_Vectorcall(hook, args, nargs, keywords);
Py_DECREF(hook);
return retval;
}
@@ -575,7 +575,7 @@ filter_next(filterobject *lz)
ok = PyObject_IsTrue(item);
} else {
PyObject *good;
- good = _PyObject_CallOneArg(lz->func, item);
+ good = PyObject_CallOneArg(lz->func, item);
if (good == NULL) {
Py_DECREF(item);
return NULL;
@@ -1631,7 +1631,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_CallOneArg(keyfunc, item);
+ val = PyObject_CallOneArg(keyfunc, item);
if (val == NULL)
goto Fail_it_item;
}
@@ -2178,7 +2178,7 @@ builtin_round_impl(PyObject *module, PyObject *number, PyObject *ndigits)
if (ndigits == Py_None)
result = _PyObject_CallNoArg(round);
else
- result = _PyObject_CallOneArg(round, ndigits);
+ result = PyObject_CallOneArg(round, ndigits);
Py_DECREF(round);
return result;
}
@@ -2234,7 +2234,7 @@ builtin_sorted(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject
}
assert(nargs >= 1);
- v = _PyObject_Vectorcall(callable, args + 1, nargs - 1, kwnames);
+ v = PyObject_Vectorcall(callable, args + 1, nargs - 1, kwnames);
Py_DECREF(callable);
if (v == NULL) {
Py_DECREF(newlist);