mirror of
https://github.com/python/cpython.git
synced 2025-09-03 15:31:08 +00:00
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
This commit is contained in:
commit
f006940351
28 changed files with 92 additions and 120 deletions
|
@ -1800,8 +1800,7 @@ compiler_class(struct compiler *c, stmt_ty s)
|
|||
{
|
||||
/* use the class name for name mangling */
|
||||
Py_INCREF(s->v.ClassDef.name);
|
||||
Py_XDECREF(c->u->u_private);
|
||||
c->u->u_private = s->v.ClassDef.name;
|
||||
Py_SETREF(c->u->u_private, s->v.ClassDef.name);
|
||||
/* load (global) __name__ ... */
|
||||
str = PyUnicode_InternFromString("__name__");
|
||||
if (!str || !compiler_nameop(c, str, Load)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue