diff options
author | Petr Viktorin <encukou@gmail.com> | 2020-02-11 16:46:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 16:46:57 (GMT) |
commit | ffd9753a944916ced659b2c77aebe66a6c9fbab5 (patch) | |
tree | f3469bdca81c102afa811a39dd3eaa9643287e93 /Objects/call.c | |
parent | f3e7ea5b8c220cd63101e419d529c8563f9c6115 (diff) | |
download | cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.zip cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.gz cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.bz2 |
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 'Objects/call.c')
-rw-r--r-- | Objects/call.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/call.c b/Objects/call.c index d1d50b6..37d079d 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -95,7 +95,7 @@ _PyObject_FastCallDictTstate(PyThreadState *tstate, PyObject *callable, { assert(callable != NULL); - /* _PyObject_FastCallDict() must not be called with an exception set, + /* PyObject_VectorcallDict() must not be called with an exception set, because it can clear it (directly or indirectly) and so the caller loses its exception */ assert(!_PyErr_Occurred(tstate)); @@ -105,7 +105,7 @@ _PyObject_FastCallDictTstate(PyThreadState *tstate, PyObject *callable, assert(nargs == 0 || args != NULL); assert(kwargs == NULL || PyDict_Check(kwargs)); - vectorcallfunc func = _PyVectorcall_Function(callable); + vectorcallfunc func = PyVectorcall_Function(callable); if (func == NULL) { /* Use tp_call instead */ return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwargs); @@ -133,7 +133,7 @@ _PyObject_FastCallDictTstate(PyThreadState *tstate, PyObject *callable, PyObject * -_PyObject_FastCallDict(PyObject *callable, PyObject *const *args, +PyObject_VectorcallDict(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwargs) { PyThreadState *tstate = _PyThreadState_GET(); @@ -204,8 +204,8 @@ PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *kwargs) { PyThreadState *tstate = _PyThreadState_GET(); - /* get vectorcallfunc as in _PyVectorcall_Function, but without - * the _Py_TPFLAGS_HAVE_VECTORCALL check */ + /* get vectorcallfunc as in PyVectorcall_Function, but without + * the Py_TPFLAGS_HAVE_VECTORCALL check */ Py_ssize_t offset = Py_TYPE(callable)->tp_vectorcall_offset; if (offset <= 0) { _PyErr_Format(tstate, PyExc_TypeError, @@ -259,7 +259,7 @@ _PyObject_Call(PyThreadState *tstate, PyObject *callable, assert(PyTuple_Check(args)); assert(kwargs == NULL || PyDict_Check(kwargs)); - if (_PyVectorcall_Function(callable) != NULL) { + if (PyVectorcall_Function(callable) != NULL) { return PyVectorcall_Call(callable, args, kwargs); } else { @@ -796,7 +796,7 @@ object_vacall(PyThreadState *tstate, PyObject *base, PyObject * -_PyObject_VectorcallMethod(PyObject *name, PyObject *const *args, +PyObject_VectorcallMethod(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { assert(name != NULL); |