diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-06-08 11:41:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-08 11:41:19 (GMT) |
commit | 6cca5c8459cc439cb050010ffa762a03859d3051 (patch) | |
tree | 9c144fde07123ff6c9d6f87a2a2b3d42883630d4 /Modules/itertoolsmodule.c | |
parent | 865de27dd79571a4a5c7a7d22a07fb909c4a9f8e (diff) | |
download | cpython-6cca5c8459cc439cb050010ffa762a03859d3051.zip cpython-6cca5c8459cc439cb050010ffa762a03859d3051.tar.gz cpython-6cca5c8459cc439cb050010ffa762a03859d3051.tar.bz2 |
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.
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r-- | Modules/itertoolsmodule.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index ee7bb66..d7a1ef0 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -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)) |