summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index f71a62e..0baf245 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1660,8 +1660,10 @@ dummy_func(
DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR);
STAT_INC(LOAD_SUPER_ATTR, hit);
PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2);
+ PyTypeObject *cls = (PyTypeObject *)class;
int method_found = 0;
- res2 = _PySuper_Lookup((PyTypeObject *)class, self, name, &method_found);
+ res2 = _PySuper_Lookup(cls, self, name,
+ cls->tp_getattro == PyObject_GenericGetAttr ? &method_found : NULL);
Py_DECREF(global_super);
Py_DECREF(class);
if (res2 == NULL) {