Mercurial > cpython-lru_cache-weakref
diff Objects/typeobject.c @ 31801:277b5a2f08f5 2.3
Ensure super() lookup of descriptor from classmethod works (SF ID# 743627)
(Backport to 2.3 maintenance branch)
| author | Phillip J. Eby <pje@telecommunity.com> |
|---|---|
| date | Thu, 25 Mar 2004 02:36:29 +0000 |
| parents | 6a8e8a13c745 |
| children | f63dd299a60b |
line wrap: on
line diff
--- a/Objects/typeobject.c Tue Mar 23 23:42:54 2004 +0000 +++ b/Objects/typeobject.c Thu Mar 25 02:36:29 2004 +0000 @@ -5496,7 +5496,14 @@ 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;
