mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
Fix refleak with nested classes. Fix originally by Amaury in r62015.
This commit is contained in:
parent
f7276c9b0e
commit
36e6310e39
1 changed files with 1 additions and 0 deletions
|
@ -1551,6 +1551,7 @@ compiler_class(struct compiler *c, stmt_ty s)
|
||||||
{
|
{
|
||||||
/* use the class name for name mangling */
|
/* use the class name for name mangling */
|
||||||
Py_INCREF(s->v.ClassDef.name);
|
Py_INCREF(s->v.ClassDef.name);
|
||||||
|
Py_XDECREF(c->u->u_private);
|
||||||
c->u->u_private = s->v.ClassDef.name;
|
c->u->u_private = s->v.ClassDef.name;
|
||||||
/* force it to have one mandatory argument */
|
/* force it to have one mandatory argument */
|
||||||
c->u->u_argcount = 1;
|
c->u->u_argcount = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue