summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2010-08-24 12:53:02 (GMT)
committerArmin Rigo <arigo@tunes.org>2010-08-24 12:53:02 (GMT)
commit5f42a852f838f831447b741cdb4db589e405b86c (patch)
treebfcf0ea94f10a41de32667fcd345411d43480ac8
parent8664d74966035c17d1582c19df199f7ad0beef3d (diff)
downloadcpython-5f42a852f838f831447b741cdb4db589e405b86c.zip
cpython-5f42a852f838f831447b741cdb4db589e405b86c.tar.gz
cpython-5f42a852f838f831447b741cdb4db589e405b86c.tar.bz2
Add the original test case of bug #1469629,
formatted according to local conventions.
-rw-r--r--Lib/test/leakers/test_dictself.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/leakers/test_dictself.py b/Lib/test/leakers/test_dictself.py
new file mode 100644
index 0000000..99bd37d
--- /dev/null
+++ b/Lib/test/leakers/test_dictself.py
@@ -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()