diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-01-25 00:00:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-01-25 00:00:28 (GMT) |
commit | d454249a368f3498c643c1fe4c2dedffe0be3df0 (patch) | |
tree | b0d3b9752e8fceb5133d1d5546557dd4f5cd2790 /Lib/test/crashers/underlying_dict.py | |
parent | f4f0e6c7a754dd13344b61487f4729555604f392 (diff) | |
download | cpython-d454249a368f3498c643c1fe4c2dedffe0be3df0.zip cpython-d454249a368f3498c643c1fe4c2dedffe0be3df0.tar.gz cpython-d454249a368f3498c643c1fe4c2dedffe0be3df0.tar.bz2 |
another pretty crasher served up by pypy
Diffstat (limited to 'Lib/test/crashers/underlying_dict.py')
-rw-r--r-- | Lib/test/crashers/underlying_dict.py | 20 |
1 files changed, 20 insertions, 0 deletions
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 |