mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
another pretty crasher served up by pypy
This commit is contained in:
parent
f4f0e6c7a7
commit
d454249a36
1 changed files with 20 additions and 0 deletions
20
Lib/test/crashers/underlying_dict.py
Normal file
20
Lib/test/crashers/underlying_dict.py
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue