mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Ensure super() lookup of descriptor from classmethod works (SF #743627)
This commit is contained in:
parent
2786d90617
commit
91a968af76
2 changed files with 22 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue