diff options
author | Georg Brandl <georg@python.org> | 2005-08-26 06:42:30 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-08-26 06:42:30 (GMT) |
commit | 02c42871cf73365dc5b6915cac2b017b2b90c81f (patch) | |
tree | a85d3fb2fc3682c2a149d213f5cf9a378868abea /Modules/operator.c | |
parent | bd77da6dab9d41ef246febf54c7928ce4496dd49 (diff) | |
download | cpython-02c42871cf73365dc5b6915cac2b017b2b90c81f.zip cpython-02c42871cf73365dc5b6915cac2b017b2b90c81f.tar.gz cpython-02c42871cf73365dc5b6915cac2b017b2b90c81f.tar.bz2 |
Disallow keyword arguments for type constructors that don't use them.
(fixes bug #1119418)
Diffstat (limited to 'Modules/operator.c')
-rw-r--r-- | Modules/operator.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/operator.c b/Modules/operator.c index 938c5e5..4e1e517 100644 --- a/Modules/operator.c +++ b/Modules/operator.c @@ -269,6 +269,9 @@ itemgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *item; int nitems; + if (!_PyArg_NoKeywords("itemgetter()", kwds)) + return NULL; + nitems = PyTuple_GET_SIZE(args); if (nitems <= 1) { if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &item)) @@ -405,6 +408,9 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *attr; int nattrs; + if (!_PyArg_NoKeywords("attrgetter()", kwds)) + return NULL; + nattrs = PyTuple_GET_SIZE(args); if (nattrs <= 1) { if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &attr)) |