diff -r 7343730185a3 Lib/test/test_module.py --- a/Lib/test/test_module.py Thu Dec 15 16:26:03 2011 +0100 +++ b/Lib/test/test_module.py Thu Dec 15 20:43:56 2011 +0000 @@ -70,9 +70,11 @@ m = ModuleType("foo") m.destroyed = destroyed s = """class A: + def __init__(self, l): + self.l = l def __del__(self): - destroyed.append(1) -a = A()""" + self.l.append(1) +a = A(destroyed)""" exec(s, m.__dict__) del m gc_collect()