summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-05-28 12:42:53 (GMT)
committerPetr Viktorin <encukou@gmail.com>2019-05-28 12:42:53 (GMT)
commiteb65e2443ac21739baf6d373abc7b4638b9d6927 (patch)
tree2197fa4322a60cbe077dfb8c03e0287cd3baabd9 /Objects/object.c
parent0811f2d81a12a3415dc2cb2744b41520c48d4db5 (diff)
downloadcpython-eb65e2443ac21739baf6d373abc7b4638b9d6927.zip
cpython-eb65e2443ac21739baf6d373abc7b4638b9d6927.tar.gz
cpython-eb65e2443ac21739baf6d373abc7b4638b9d6927.tar.bz2
bpo-36922: implement PEP-590 Py_TPFLAGS_METHOD_DESCRIPTOR (GH-13338)
Co-authored-by: Mark Shannon <mark@hotpy.org>
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 270716f..87dba98 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1155,8 +1155,7 @@ _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method)
descr = _PyType_Lookup(tp, name);
if (descr != NULL) {
Py_INCREF(descr);
- if (PyFunction_Check(descr) ||
- (Py_TYPE(descr) == &PyMethodDescr_Type)) {
+ if (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) {
meth_found = 1;
} else {
f = descr->ob_type->tp_descr_get;