mirror of
https://github.com/python/cpython
synced 2026-09-29 10:15:30 +03:00
don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ (closes #16271)
This commit is contained in:
parent
e8ea97fffb
commit
8afa7fa510
3 changed files with 11 additions and 9 deletions
|
|
@ -2250,11 +2250,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
|
|||
goto error;
|
||||
}
|
||||
}
|
||||
else {
|
||||
qualname = et->ht_name;
|
||||
}
|
||||
Py_INCREF(qualname);
|
||||
et->ht_qualname = qualname;
|
||||
et->ht_qualname = qualname ? qualname : et->ht_name;
|
||||
Py_INCREF(et->ht_qualname);
|
||||
if (qualname != NULL && PyDict_DelItem(dict, PyId___qualname__.object) < 0)
|
||||
goto error;
|
||||
|
||||
/* Set tp_doc to a copy of dict['__doc__'], if the latter is there
|
||||
and is a string. The __doc__ accessor will first look for tp_doc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue