bpo-30592: Fixed error messages for some builtins. (#1996)

Error messages when pass keyword arguments to some builtins that
don't support keyword arguments contained double parenthesis: "()()".
The regression was introduced by bpo-30534.
This commit is contained in:
Serhiy Storchaka 2017-06-08 14:41:19 +03:00 • committed by GitHub
parent 865de27dd7
commit 6cca5c8459
13 changed files with 23 additions and 23 deletions

View file

@ -871,7 +871,7 @@ cycle_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *saved;
cycleobject *lz;
if (type == &cycle_type && !_PyArg_NoKeywords("cycle()", kwds))
if (type == &cycle_type && !_PyArg_NoKeywords("cycle", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "cycle", 1, 1, &iterable))
@ -1072,7 +1072,7 @@ dropwhile_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *it;
dropwhileobject *lz;
if (type == &dropwhile_type && !_PyArg_NoKeywords("dropwhile()", kwds))
if (type == &dropwhile_type && !_PyArg_NoKeywords("dropwhile", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "dropwhile", 2, 2, &func, &seq))
@ -1240,7 +1240,7 @@ takewhile_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *it;
takewhileobject *lz;
if (type == &takewhile_type && !_PyArg_NoKeywords("takewhile()", kwds))
if (type == &takewhile_type && !_PyArg_NoKeywords("takewhile", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "takewhile", 2, 2, &func, &seq))
@ -1408,7 +1408,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_ssize_t numargs;
isliceobject *lz;
if (type == &islice_type && !_PyArg_NoKeywords("islice()", kwds))
if (type == &islice_type && !_PyArg_NoKeywords("islice", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "islice", 2, 4, &seq, &a1, &a2, &a3))
@ -1662,7 +1662,7 @@ starmap_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *it;
starmapobject *lz;
if (type == &starmap_type && !_PyArg_NoKeywords("starmap()", kwds))
if (type == &starmap_type && !_PyArg_NoKeywords("starmap", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "starmap", 2, 2, &func, &seq))
@ -1820,7 +1820,7 @@ chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *source;
if (type == &chain_type && !_PyArg_NoKeywords("chain()", kwds))
if (type == &chain_type && !_PyArg_NoKeywords("chain", kwds))
return NULL;
source = PyObject_GetIter(args);
@ -3769,7 +3769,7 @@ filterfalse_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
filterfalseobject *lz;
if (type == &filterfalse_type &&
!_PyArg_NoKeywords("filterfalse()", kwds))
!_PyArg_NoKeywords("filterfalse", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "filterfalse", 2, 2, &func, &seq))