summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-06-08 11:41:19 (GMT)
committerGitHub <noreply@github.com>2017-06-08 11:41:19 (GMT)
commit6cca5c8459cc439cb050010ffa762a03859d3051 (patch)
tree9c144fde07123ff6c9d6f87a2a2b3d42883630d4 /Objects
parent865de27dd79571a4a5c7a7d22a07fb909c4a9f8e (diff)
downloadcpython-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 'Objects')
-rw-r--r--Objects/boolobject.c2
-rw-r--r--Objects/rangeobject.c2
-rw-r--r--Objects/setobject.c4
-rw-r--r--Objects/sliceobject.c2
-rw-r--r--Objects/weakrefobject.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/Objects/boolobject.c b/Objects/boolobject.c
index becdfcb..b92fafe 100644
--- a/Objects/boolobject.c
+++ b/Objects/boolobject.c
@@ -45,7 +45,7 @@ bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *x = Py_False;
long ok;
- if (!_PyArg_NoKeywords("bool()", kwds))
+ if (!_PyArg_NoKeywords("bool", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "bool", 0, 1, &x))
return NULL;
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 554528d..dd0e4be 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -74,7 +74,7 @@ range_new(PyTypeObject *type, PyObject *args, PyObject *kw)
rangeobject *obj;
PyObject *start = NULL, *stop = NULL, *step = NULL;
- if (!_PyArg_NoKeywords("range()", kw))
+ if (!_PyArg_NoKeywords("range", kw))
return NULL;
if (PyTuple_Size(args) <= 1) {
diff --git a/Objects/setobject.c b/Objects/setobject.c
index a9dba31..2347b9d 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1083,7 +1083,7 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *iterable = NULL, *result;
- if (type == &PyFrozenSet_Type && !_PyArg_NoKeywords("frozenset()", kwds))
+ if (type == &PyFrozenSet_Type && !_PyArg_NoKeywords("frozenset", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &iterable))
@@ -2006,7 +2006,7 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds)
{
PyObject *iterable = NULL;
- if (!_PyArg_NoKeywords("set()", kwds))
+ if (!_PyArg_NoKeywords("set", kwds))
return -1;
if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1;
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 4263737..b5aabfd 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -297,7 +297,7 @@ slice_new(PyTypeObject *type, PyObject *args, PyObject *kw)
start = stop = step = NULL;
- if (!_PyArg_NoKeywords("slice()", kw))
+ if (!_PyArg_NoKeywords("slice", kw))
return NULL;
if (!PyArg_UnpackTuple(args, "slice", 1, 3, &start, &stop, &step))
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index da05950..f600179 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -332,7 +332,7 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *tmp;
- if (!_PyArg_NoKeywords("ref()", kwargs))
+ if (!_PyArg_NoKeywords("ref", kwargs))
return -1;
if (parse_weakref_init_args("__init__", args, kwargs, &tmp, &tmp))