]> granicus.if.org Git - python/commitdiff
Add the original test case of bug #1469629,
authorArmin Rigo <arigo@tunes.org>
Tue, 24 Aug 2010 12:53:02 +0000 (12:53 +0000)
committerArmin Rigo <arigo@tunes.org>
Tue, 24 Aug 2010 12:53:02 +0000 (12:53 +0000)
formatted according to local conventions.

Lib/test/leakers/test_dictself.py [new file with mode: 0644]

diff --git a/Lib/test/leakers/test_dictself.py b/Lib/test/leakers/test_dictself.py
new file mode 100644 (file)
index 0000000..99bd37d
--- /dev/null
@@ -0,0 +1,12 @@
+'''Test case for "self.__dict__ = self" circular reference bug (#1469629)'''
+
+import gc
+
+class LeakyDict(dict):
+    pass
+
+def leak():
+    ld = LeakyDict()
+    ld.__dict__ = ld
+    del ld
+    gc.collect(); gc.collect(); gc.collect()