summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2023-07-24 20:14:56 (GMT)
committerGitHub <noreply@github.com>2023-07-24 20:14:56 (GMT)
commite5d5522612e03af3941db1d270bf6caebf330b8a (patch)
treedc84c18df681a635a2bd4ff930d077daa21407c2 /Python
parentb38370349139e06f3a44150943ee44e345567d77 (diff)
downloadcpython-e5d5522612e03af3941db1d270bf6caebf330b8a.zip
cpython-e5d5522612e03af3941db1d270bf6caebf330b8a.tar.gz
cpython-e5d5522612e03af3941db1d270bf6caebf330b8a.tar.bz2
gh-106917: fix super classmethod calls to non-classmethods (#106977)
Diffstat (limited to 'Python')
-rw-r--r--Python/bytecodes.c2
-rw-r--r--Python/executor_cases.c.h2
-rw-r--r--Python/generated_cases.c.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 7ce8978..0705f5b 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -1721,7 +1721,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/executor_cases.c.h b/Python/executor_cases.c.h
index 064965a..0f04b42 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -1406,7 +1406,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) {
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 9d25fc6..02ad69a 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -2154,7 +2154,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) {