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

@ -1038,7 +1038,7 @@ double_round(double x, int ndigits) {
/* round a Python float v to the closest multiple of 10**-ndigits */
static PyObject *
float_round(PyObject *v, PyObject **args, Py_ssize_t nargs)
float_round(PyObject *v, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
double x, rounded;
PyObject *o_ndigits = NULL;
@ -1048,6 +1048,9 @@ float_round(PyObject *v, PyObject **args, Py_ssize_t nargs)
if (!_PyArg_UnpackStack(args, nargs, "__round__", 0, 1, &o_ndigits))
return NULL;
if(!_PyArg_NoStackKeywords("__round__", kwnames))
return NULL;
if (o_ndigits == NULL || o_ndigits == Py_None) {
/* single-argument round or with None ndigits:
* round to nearest integer */
@ -1763,7 +1766,7 @@ float_getzero(PyObject *v, void *closure)
}
static PyObject *
float__format__(PyObject *self, PyObject **args, Py_ssize_t nargs)
float__format__(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *format_spec;
_PyUnicodeWriter writer;
@ -1772,6 +1775,9 @@ float__format__(PyObject *self, PyObject **args, Py_ssize_t nargs)
if (!_PyArg_ParseStack(args, nargs, "U:__format__", &format_spec))
return NULL;
if(!_PyArg_NoStackKeywords("__format__", kwnames))
return NULL;
_PyUnicodeWriter_Init(&writer);
ret = _PyFloat_FormatAdvancedWriter(
&writer,