diff options
author | Georg Brandl <georg@python.org> | 2006-02-21 22:13:44 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-02-21 22:13:44 (GMT) |
commit | d02db4084e666b95aec7e042800319c6c77d825f (patch) | |
tree | aa7e45aef488c4b323d0fed8b0f07edd8838f064 /Objects/funcobject.c | |
parent | 7d42d3cd5999e0691d63267fda03fefde34e0a2d (diff) | |
download | cpython-d02db4084e666b95aec7e042800319c6c77d825f.zip cpython-d02db4084e666b95aec7e042800319c6c77d825f.tar.gz cpython-d02db4084e666b95aec7e042800319c6c77d825f.tar.bz2 |
Make staticmethod and classmethod complain about keyword args.
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r-- | Objects/funcobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index fe34a11..6c68349 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -686,6 +686,8 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds) 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 @@ sm_init(PyObject *self, PyObject *args, PyObject *kwds) 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; |