summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSylvain <sylvain.desodt+github@gmail.com>2017-07-09 03:45:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-07-09 03:45:06 (GMT)
commit9648088e6ccd6d0cc04f450f55628fd8eda3784c (patch)
tree8e2e1d797604ea31db5f30070f38a955f213def3 /Objects
parentaa6a4d6ed881f79c51fb91dd928ed9496737b420 (diff)
downloadcpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.zip
cpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.tar.gz
cpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.tar.bz2
bpo-30878: Fix error message when keyword arguments are passed (#2635)
to staticmethod() and classmethod().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/funcobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 8410001..e440258 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -702,10 +702,10 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds)
classmethod *cm = (classmethod *)self;
PyObject *callable;
- if (!PyArg_UnpackTuple(args, "classmethod", 1, 1, &callable))
- return -1;
if (!_PyArg_NoKeywords("classmethod", kwds))
return -1;
+ if (!PyArg_UnpackTuple(args, "classmethod", 1, 1, &callable))
+ return -1;
Py_INCREF(callable);
cm->cm_callable = callable;
return 0;
@@ -883,10 +883,10 @@ sm_init(PyObject *self, PyObject *args, PyObject *kwds)
staticmethod *sm = (staticmethod *)self;
PyObject *callable;
- if (!PyArg_UnpackTuple(args, "staticmethod", 1, 1, &callable))
- return -1;
if (!_PyArg_NoKeywords("staticmethod", kwds))
return -1;
+ if (!PyArg_UnpackTuple(args, "staticmethod", 1, 1, &callable))
+ return -1;
Py_INCREF(callable);
sm->sm_callable = callable;
return 0;