Mercurial > cpython-lru_cache-weakref
diff Objects/funcobject.c @ 39960:f019e4f86287 2.4
[Backport rev. 42545 by georg.brandl]
Make staticmethod and classmethod complain about keyword args.
| author | Andrew M. Kuchling <amk@amk.ca> |
|---|---|
| date | Tue, 03 Oct 2006 18:25:19 +0000 |
| parents | 67937a3852fe |
| children | 5bec4a67ff0d |
line wrap: on
line diff
--- a/Objects/funcobject.c Tue Oct 03 14:07:53 2006 +0000 +++ b/Objects/funcobject.c Tue Oct 03 18:25:19 2006 +0000 @@ -684,6 +684,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); @@ -840,6 +842,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;
