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
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 1a98d2f..0aba1c2 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -398,6 +398,10 @@
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)