mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-19072: Make @classmethod support chained decorators (GH-8405)
This commit is contained in:
parent
0dfc025ccc
commit
805f8f9afe
5 changed files with 71 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue