commit | 805f8f9afea116c5d4d000570e3d02ae84502f43 | [log] [tgz] |
---|---|---|
author | Berker Peksag <berker.peksag@gmail.com> | Sun Aug 25 01:37:25 2019 +0300 |
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | Sat Aug 24 15:37:25 2019 -0700 |
tree | fcce9d4e198f5788b6cc5befc349c988d9c05c3c | |
parent | 0dfc025cccc5adf4f209e2421c7686b1e637eeae [diff] [blame] |
bpo-19072: Make @classmethod support chained decorators (GH-8405)
diff --git a/Objects/funcobject.c b/Objects/funcobject.c index a65c1f4..b6ffc2a 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c
@@ -741,6 +741,10 @@ } 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); }