]> granicus.if.org Git - python/commitdiff
another pretty crasher served up by pypy
authorBenjamin Peterson <benjamin@python.org>
Tue, 25 Jan 2011 00:00:28 +0000 (00:00 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 25 Jan 2011 00:00:28 +0000 (00:00 +0000)
Lib/test/crashers/underlying_dict.py [new file with mode: 0644]

diff --git a/Lib/test/crashers/underlying_dict.py b/Lib/test/crashers/underlying_dict.py
new file mode 100644 (file)
index 0000000..a4b7993
--- /dev/null
@@ -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