mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
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
This commit is contained in:
parent
f3e7ea5b8c
commit
ffd9753a94
56 changed files with 194 additions and 194 deletions
|
@ -777,14 +777,14 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
|
|||
*next_idx_ptr = idx + 1;
|
||||
|
||||
if (has_pairs_hook) {
|
||||
val = _PyObject_CallOneArg(s->object_pairs_hook, rval);
|
||||
val = PyObject_CallOneArg(s->object_pairs_hook, rval);
|
||||
Py_DECREF(rval);
|
||||
return val;
|
||||
}
|
||||
|
||||
/* if object_hook is not None: rval = object_hook(rval) */
|
||||
if (s->object_hook != Py_None) {
|
||||
val = _PyObject_CallOneArg(s->object_hook, rval);
|
||||
val = PyObject_CallOneArg(s->object_hook, rval);
|
||||
Py_DECREF(rval);
|
||||
return val;
|
||||
}
|
||||
|
@ -890,7 +890,7 @@ _parse_constant(PyScannerObject *s, const char *constant, Py_ssize_t idx, Py_ssi
|
|||
return NULL;
|
||||
|
||||
/* rval = parse_constant(constant) */
|
||||
rval = _PyObject_CallOneArg(s->parse_constant, cstr);
|
||||
rval = PyObject_CallOneArg(s->parse_constant, cstr);
|
||||
idx += PyUnicode_GET_LENGTH(cstr);
|
||||
Py_DECREF(cstr);
|
||||
*next_idx_ptr = idx;
|
||||
|
@ -989,7 +989,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
|
|||
idx - start);
|
||||
if (numstr == NULL)
|
||||
return NULL;
|
||||
rval = _PyObject_CallOneArg(custom_func, numstr);
|
||||
rval = PyObject_CallOneArg(custom_func, numstr);
|
||||
}
|
||||
else {
|
||||
Py_ssize_t i, n;
|
||||
|
@ -1399,7 +1399,7 @@ encoder_encode_string(PyEncoderObject *s, PyObject *obj)
|
|||
if (s->fast_encode) {
|
||||
return s->fast_encode(NULL, obj);
|
||||
}
|
||||
encoded = _PyObject_CallOneArg(s->encoder, obj);
|
||||
encoded = PyObject_CallOneArg(s->encoder, obj);
|
||||
if (encoded != NULL && !PyUnicode_Check(encoded)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"encoder() must return a string, not %.80s",
|
||||
|
@ -1485,7 +1485,7 @@ encoder_listencode_obj(PyEncoderObject *s, _PyAccu *acc,
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
newobj = _PyObject_CallOneArg(s->defaultfn, obj);
|
||||
newobj = PyObject_CallOneArg(s->defaultfn, obj);
|
||||
if (newobj == NULL) {
|
||||
Py_XDECREF(ident);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue