mirror of
https://github.com/python/cpython.git
synced 2025-10-08 16:11:51 +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
|
@ -69,8 +69,7 @@ module_init_dict(PyModuleObject *mod, PyObject *md_dict,
|
|||
return -1;
|
||||
if (PyUnicode_CheckExact(name)) {
|
||||
Py_INCREF(name);
|
||||
Py_XDECREF(mod->md_name);
|
||||
mod->md_name = name;
|
||||
Py_SETREF(mod->md_name, name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue