diff Modules/operator.c @ 35450:97c97194e64b 2.4

Disallow keyword arguments for type constructors that don't use them (fixes #1119418).
author Georg Brandl <georg@python.org>
date Fri, 26 Aug 2005 06:43:16 +0000
parents d7630ce7aa9f
children 38e588d1d885
line wrap: on
line diff
--- a/Modules/operator.c	Thu Aug 25 22:40:21 2005 +0000
+++ b/Modules/operator.c	Fri Aug 26 06:43:16 2005 +0000
@@ -267,6 +267,9 @@
 	itemgetterobject *ig;
 	PyObject *item;
 
+	if (!_PyArg_NoKeywords("itemgetter()", kdws))
+		return NULL;
+
 	if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &item))
 		return NULL;
 
@@ -374,6 +377,9 @@
 	attrgetterobject *ag;
 	PyObject *attr;
 
+	if (!_PyArg_NoKeywords("attrgetter()", kwds))
+		return NULL;
+
 	if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &attr))
 		return NULL;