mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Fix a reference leak found by Georg, when compiling a class nested in another class.
Now "regrtest.py -R:: test_compile" is satisfied. Will backport.
This commit is contained in:
parent
aa5fbdd71a
commit
69b747b735
2 changed files with 4 additions and 0 deletions
|
@ -1431,6 +1431,7 @@ compiler_class(struct compiler *c, stmt_ty s)
|
|||
if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s,
|
||||
s->lineno))
|
||||
return 0;
|
||||
Py_XDECREF(c->u->u_private);
|
||||
c->u->u_private = s->v.ClassDef.name;
|
||||
Py_INCREF(c->u->u_private);
|
||||
str = PyString_InternFromString("__name__");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue