summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-06-17 11:53:21 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-06-17 11:53:20 (GMT)
commit2e9954d3472a23919b96323fcd5bb6c1d6927155 (patch)
tree39523411183191750fd007cb2d3cb27d0ba08b62 /Objects
parent0456df4a55ec9a4e8f4425df92bbe63a290f3f2f (diff)
downloadcpython-2e9954d3472a23919b96323fcd5bb6c1d6927155.zip
cpython-2e9954d3472a23919b96323fcd5bb6c1d6927155.tar.gz
cpython-2e9954d3472a23919b96323fcd5bb6c1d6927155.tar.bz2
bpo-36922: use Py_TPFLAGS_METHOD_DESCRIPTOR in lookup_maybe_method() (GH-13865)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index ba128a9..e495251 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1412,7 +1412,7 @@ lookup_maybe_method(PyObject *self, _Py_Identifier *attrid, int *unbound)
return NULL;
}
- if (PyFunction_Check(res)) {
+ if (PyType_HasFeature(Py_TYPE(res), Py_TPFLAGS_METHOD_DESCRIPTOR)) {
/* Avoid temporary PyMethodObject */
*unbound = 1;
Py_INCREF(res);