[Python-checkins] r42545 - python/trunk/Objects/funcobject.c

georg.brandl python-checkins at python.org
Tue Feb 21 23:13:47 CET 2006


Author: georg.brandl
Date: Tue Feb 21 23:13:44 2006
New Revision: 42545

Modified:
   python/trunk/Objects/funcobject.c
Log:
Make staticmethod and classmethod complain about keyword args.



Modified: python/trunk/Objects/funcobject.c
==============================================================================
--- python/trunk/Objects/funcobject.c	(original)
+++ python/trunk/Objects/funcobject.c	Tue Feb 21 23:13:44 2006
@@ -686,6 +686,8 @@
 
 	if (!PyArg_UnpackTuple(args, "classmethod", 1, 1, &callable))
 		return -1;
+	if (!_PyArg_NoKeywords("classmethod", kwds))
+		return -1;
 	if (!PyCallable_Check(callable)) {
 		PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
 		     callable->ob_type->tp_name);
@@ -842,6 +844,8 @@
 
 	if (!PyArg_UnpackTuple(args, "staticmethod", 1, 1, &callable))
 		return -1;
+	if (!_PyArg_NoKeywords("staticmethod", kwds))
+		return -1;
 	Py_INCREF(callable);
 	sm->sm_callable = callable;
 	return 0;


More information about the Python-checkins mailing list