[3.12] gh-106917: fix super classmethod calls to non-classmethods (GH-106977). (#107204)

(cherry picked from commit e5d5522612)
This commit is contained in:
Carl Meyer 2023-07-24 15:13:17 -06:00 committed by GitHub
parent 3923639a77
commit 5fd028b677
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 4 deletions

View file

@ -1663,7 +1663,7 @@ dummy_func(
PyTypeObject *cls = (PyTypeObject *)class;
int method_found = 0;
res2 = _PySuper_Lookup(cls, self, name,
cls->tp_getattro == PyObject_GenericGetAttr ? &method_found : NULL);
Py_TYPE(self)->tp_getattro == PyObject_GenericGetAttr ? &method_found : NULL);
Py_DECREF(global_super);
Py_DECREF(class);
if (res2 == NULL) {