summaryrefslogtreecommitdiff
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2019-08-25 01:37:25 +0300
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-24 15:37:25 -0700
commit805f8f9afea116c5d4d000570e3d02ae84502f43 (patch)
treefcce9d4e198f5788b6cc5befc349c988d9c05c3c /Objects/funcobject.c
parent0dfc025cccc5adf4f209e2421c7686b1e637eeae (diff)
downloadcpython-git-805f8f9afea116c5d4d000570e3d02ae84502f43.tar.gz
bpo-19072: Make @classmethod support chained decorators (GH-8405)
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index a65c1f4a55..b6ffc2a184 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -741,6 +741,10 @@ cm_descr_get(PyObject *self, PyObject *obj, PyObject *type)
}
if (type == NULL)
type = (PyObject *)(Py_TYPE(obj));
+ if (Py_TYPE(cm->cm_callable)->tp_descr_get != NULL) {
+ return Py_TYPE(cm->cm_callable)->tp_descr_get(cm->cm_callable, type,
+ NULL);
+ }
return PyMethod_New(cm->cm_callable, type);
}