Revert "Backport METH_FASTCALL from Python 3.7 (#328)"

This reverts commit cf73bbd678.
This commit is contained in:
Justine Tunney 2022-05-12 06:49:54 -07:00
parent e7611a8476
commit 2ea1dc405c
102 changed files with 3299 additions and 2894 deletions

View file

@ -18,7 +18,7 @@ PyDoc_STRVAR(bytes_split__doc__,
" -1 (the default value) means no limit.");
#define BYTES_SPLIT_METHODDEF \
{"split", (PyCFunction)bytes_split, METH_FASTCALL|METH_KEYWORDS, bytes_split__doc__},
{"split", (PyCFunction)bytes_split, METH_FASTCALL, bytes_split__doc__},
static PyObject *
bytes_split_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit);
@ -137,7 +137,7 @@ PyDoc_STRVAR(bytes_rsplit__doc__,
"Splitting is done starting at the end of the bytes and working to the front.");
#define BYTES_RSPLIT_METHODDEF \
{"rsplit", (PyCFunction)bytes_rsplit, METH_FASTCALL|METH_KEYWORDS, bytes_rsplit__doc__},
{"rsplit", (PyCFunction)bytes_rsplit, METH_FASTCALL, bytes_rsplit__doc__},
static PyObject *
bytes_rsplit_impl(PyBytesObject *self, PyObject *sep, Py_ssize_t maxsplit);
@ -191,7 +191,7 @@ static PyObject *
bytes_strip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
@ -201,6 +201,10 @@ bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
&bytes)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("strip", kwnames)) {
goto exit;
}
return_value = bytes_strip_impl(self, bytes);
exit:
@ -222,7 +226,7 @@ static PyObject *
bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
@ -232,6 +236,10 @@ bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
&bytes)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
goto exit;
}
return_value = bytes_lstrip_impl(self, bytes);
exit:
@ -253,7 +261,7 @@ static PyObject *
bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
@ -263,6 +271,10 @@ bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
&bytes)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
goto exit;
}
return_value = bytes_rstrip_impl(self, bytes);
exit:
@ -282,7 +294,7 @@ PyDoc_STRVAR(bytes_translate__doc__,
"The remaining characters are mapped through the given translation table.");
#define BYTES_TRANSLATE_METHODDEF \
{"translate", (PyCFunction)bytes_translate, METH_FASTCALL|METH_KEYWORDS, bytes_translate__doc__},
{"translate", (PyCFunction)bytes_translate, METH_FASTCALL, bytes_translate__doc__},
static PyObject *
bytes_translate_impl(PyBytesObject *self, PyObject *table,
@ -325,7 +337,7 @@ static PyObject *
bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to);
static PyObject *
bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs)
bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer frm = {NULL, NULL};
@ -335,6 +347,10 @@ bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs)
&frm, &to)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
goto exit;
}
return_value = bytes_maketrans_impl(&frm, &to);
exit:
@ -371,7 +387,7 @@ bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
Py_ssize_t count);
static PyObject *
bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer old = {NULL, NULL};
@ -382,6 +398,10 @@ bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs)
&old, &new, &count)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("replace", kwnames)) {
goto exit;
}
return_value = bytes_replace_impl(self, &old, &new, count);
exit:
@ -413,7 +433,7 @@ PyDoc_STRVAR(bytes_decode__doc__,
" can handle UnicodeDecodeErrors.");
#define BYTES_DECODE_METHODDEF \
{"decode", (PyCFunction)bytes_decode, METH_FASTCALL|METH_KEYWORDS, bytes_decode__doc__},
{"decode", (PyCFunction)bytes_decode, METH_FASTCALL, bytes_decode__doc__},
static PyObject *
bytes_decode_impl(PyBytesObject *self, const char *encoding,
@ -448,7 +468,7 @@ PyDoc_STRVAR(bytes_splitlines__doc__,
"true.");
#define BYTES_SPLITLINES_METHODDEF \
{"splitlines", (PyCFunction)bytes_splitlines, METH_FASTCALL|METH_KEYWORDS, bytes_splitlines__doc__},
{"splitlines", (PyCFunction)bytes_splitlines, METH_FASTCALL, bytes_splitlines__doc__},
static PyObject *
bytes_splitlines_impl(PyBytesObject *self, int keepends);
@ -500,4 +520,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
exit:
return return_value;
}
/*[clinic end generated code: output=fc9e02359cc56d36 input=a9049054013a1b77]*/
/*[clinic end generated code: output=debf785947e0eec2 input=a9049054013a1b77]*/