mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
This commit is contained in:
parent
a198645fa0
commit
5a57ade58e
28 changed files with 92 additions and 120 deletions
|
|
@ -1509,8 +1509,7 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
PyObject *get_doc = _PyObject_GetAttrId(get, &PyId___doc__);
|
||||
if (get_doc) {
|
||||
if (Py_TYPE(self) == &PyProperty_Type) {
|
||||
Py_XDECREF(prop->prop_doc);
|
||||
prop->prop_doc = get_doc;
|
||||
Py_SETREF(prop->prop_doc, get_doc);
|
||||
}
|
||||
else {
|
||||
/* If this is a property subclass, put __doc__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue