[Python-checkins] r88178 - python/branches/py3k/Lib/test/crashers/underlying_dict.py

benjamin.peterson python-checkins at python.org
Tue Jan 25 01:00:28 CET 2011


Author: benjamin.peterson
Date: Tue Jan 25 01:00:28 2011
New Revision: 88178

Log:
another pretty crasher served up by pypy

Added:
   python/branches/py3k/Lib/test/crashers/underlying_dict.py   (contents, props changed)

Added: python/branches/py3k/Lib/test/crashers/underlying_dict.py
==============================================================================
--- (empty file)
+++ python/branches/py3k/Lib/test/crashers/underlying_dict.py	Tue Jan 25 01:00:28 2011
@@ -0,0 +1,20 @@
+import gc
+
+thingy = object()
+class A(object):
+    def f(self):
+        return 1
+    x = thingy
+
+r = gc.get_referrers(thingy)
+if "__module__" in r[0]:
+    dct = r[0]
+else:
+    dct = r[1]
+
+a = A()
+for i in range(10):
+    a.f()
+dct["f"] = lambda self: 2
+
+print(a.f()) # should print 1


More information about the Python-checkins mailing list