Skip to content

Commit 8fff072

Browse files
committed
no need to deopt
1 parent 289d6a6 commit 8fff072

File tree

3 files changed

+225
-228
lines changed

3 files changed

+225
-228
lines changed

Python/bytecodes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,11 +1658,12 @@ dummy_func(
16581658
assert(oparg & 1);
16591659
DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR);
16601660
DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR);
1661-
DEOPT_IF(((PyTypeObject *)class)->tp_getattro != PyObject_GenericGetAttr, LOAD_SUPER_ATTR);
16621661
STAT_INC(LOAD_SUPER_ATTR, hit);
16631662
PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2);
1663+
PyTypeObject *cls = (PyTypeObject *)class;
16641664
int method_found = 0;
1665-
res2 = _PySuper_Lookup((PyTypeObject *)class, self, name, &method_found);
1665+
res2 = _PySuper_Lookup(cls, self, name,
1666+
cls->tp_getattro == PyObject_GenericGetAttr ? &method_found : NULL);
16661667
Py_DECREF(global_super);
16671668
Py_DECREF(class);
16681669
if (res2 == NULL) {

0 commit comments

Comments
 (0)