Disallow keyword arguments for type constructors that don't use them.
(fixes bug #1119418)
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 @@
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 @@
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))