Kaydet (Commit) 69b747b7 authored tarafından Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

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.
üst aa5fbdd7
......@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 2?
Core and builtins
-----------------
- The compilation of a class nested in another class used to leak one
reference on the outer class name.
- Patch #1810: compile() can now compile _ast trees as returned by
compile(..., PyCF_ONLY_AST).
......
......@@ -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__");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment