diff options
author | Carl Meyer <carl@oddbird.net> | 2023-07-24 21:13:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 21:13:17 (GMT) |
commit | 5fd028b677ae1dd20a60fc2f43d4380b809d70f0 (patch) | |
tree | 5812a87b8c1792e73f98712500cf17bd9848c1e9 /Python | |
parent | 3923639a77656915c3499b0283a45da727308f2a (diff) | |
download | cpython-5fd028b677ae1dd20a60fc2f43d4380b809d70f0.zip cpython-5fd028b677ae1dd20a60fc2f43d4380b809d70f0.tar.gz cpython-5fd028b677ae1dd20a60fc2f43d4380b809d70f0.tar.bz2 |
[3.12] gh-106917: fix super classmethod calls to non-classmethods (GH-106977). (#107204)
(cherry picked from commit e5d5522612e03af3941db1d270bf6caebf330b8a)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bytecodes.c | 2 | ||||
-rw-r--r-- | Python/generated_cases.c.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 0baf245..b914afa 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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) { diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 103373e..281c8b5 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2411,7 +2411,7 @@ 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) { |