Fix a reference leak found by Georg, when compiling a class nested in another class.

Test is run with "regrtest.py -R:: test_compile"

Backport of r62015
This commit is contained in:
Amaury Forgeot d'Arc 2008-03-28 20:45:42 +00:00
parent 198e353735
commit 8432d86b9f
3 changed files with 8 additions and 0 deletions

View file

@ -398,6 +398,10 @@ if 1:
del d[..., ...]
self.assertEqual((Ellipsis, Ellipsis) in d, False)
def test_nested_classes(self):
# Verify that it does not leak
compile("class A:\n class B: pass", 'tmp', 'exec')
def test_main():
test_support.run_unittest(TestSpecifics)