summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/recursive_call.py2
-rw-r--r--Lib/test/crashers/underlying_dict.py20
2 files changed, 21 insertions, 1 deletions
diff --git a/Lib/test/crashers/recursive_call.py b/Lib/test/crashers/recursive_call.py
index 31c8963..2d160a7 100644
--- a/Lib/test/crashers/recursive_call.py
+++ b/Lib/test/crashers/recursive_call.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# No bug report AFAIK, mail on python-dev on 2006-01-10
diff --git a/Lib/test/crashers/underlying_dict.py b/Lib/test/crashers/underlying_dict.py
new file mode 100644
index 0000000..a4b7993
--- /dev/null
+++ b/Lib/test/crashers/underlying_dict.py
@@ -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