diff options
author | Phillip J. Eby <pje@telecommunity.com> | 2004-03-25 02:19:34 (GMT) |
---|---|---|
committer | Phillip J. Eby <pje@telecommunity.com> | 2004-03-25 02:19:34 (GMT) |
commit | 91a968af7640348d92011e305127d5968958aff4 (patch) | |
tree | 43882cd6e010b527a36c4ca92acc193fc59002d7 /Objects | |
parent | 2786d90617993c5958a477067b20882395de5ac9 (diff) | |
download | cpython-91a968af7640348d92011e305127d5968958aff4.zip cpython-91a968af7640348d92011e305127d5968958aff4.tar.gz cpython-91a968af7640348d92011e305127d5968958aff4.tar.bz2 |
Ensure super() lookup of descriptor from classmethod works (SF #743627)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f26ddd6..209ec32 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5537,7 +5537,14 @@ super_getattro(PyObject *self, PyObject *name) Py_INCREF(res); f = res->ob_type->tp_descr_get; if (f != NULL) { - tmp = f(res, su->obj, + tmp = f(res, + /* Only pass 'obj' param if + this is instance-mode super + (See SF ID #743627) + */ + (su->obj==su->obj_type + ? (PyObject *)NULL + : su->obj), (PyObject *)starttype); Py_DECREF(res); res = tmp; |