summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-04-02 17:53:47 (GMT)
committerGuido van Rossum <guido@python.org>2002-04-02 17:53:47 (GMT)
commit155db9aa222e96fcaf2db4d80b414098889a7c5d (patch)
tree1140cb6381b5c3b90189de53c9f0f0919f556fae /Objects
parent103b548a76535720cd379ea6295958caa8e6e025 (diff)
downloadcpython-155db9aa222e96fcaf2db4d80b414098889a7c5d.zip
cpython-155db9aa222e96fcaf2db4d80b414098889a7c5d.tar.gz
cpython-155db9aa222e96fcaf2db4d80b414098889a7c5d.tar.bz2
SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods. Bugfix candidate.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 474a97c..a2fe27c 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4021,10 +4021,13 @@ super_getattro(PyObject *self, PyObject *name)
if (su->obj != NULL) {
PyObject *mro, *res, *tmp, *dict;
+ PyTypeObject *starttype;
descrgetfunc f;
int i, n;
- mro = su->obj->ob_type->tp_mro;
+ starttype = su->obj->ob_type;
+ mro = starttype->tp_mro;
+
if (mro == NULL)
n = 0;
else {
@@ -4036,7 +4039,8 @@ super_getattro(PyObject *self, PyObject *name)
break;
}
if (i >= n && PyType_Check(su->obj)) {
- mro = ((PyTypeObject *)(su->obj))->tp_mro;
+ starttype = (PyTypeObject *)(su->obj);
+ mro = starttype->tp_mro;
if (mro == NULL)
n = 0;
else {
@@ -4064,7 +4068,7 @@ super_getattro(PyObject *self, PyObject *name)
Py_INCREF(res);
f = res->ob_type->tp_descr_get;
if (f != NULL) {
- tmp = f(res, su->obj, res);
+ tmp = f(res, su->obj, (PyObject *)starttype);
Py_DECREF(res);
res = tmp;
}