From d454249a368f3498c643c1fe4c2dedffe0be3df0 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 25 Jan 2011 00:00:28 +0000 Subject: [PATCH] another pretty crasher served up by pypy --- Lib/test/crashers/underlying_dict.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Lib/test/crashers/underlying_dict.py diff --git a/Lib/test/crashers/underlying_dict.py b/Lib/test/crashers/underlying_dict.py new file mode 100644 index 0000000000..a4b7993743 --- /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 -- 2.40.0