[Python-checkins] python/dist/src/Lib/test test_descr.py,1.113.4.30,1.113.4.31
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
2003年5月29日 07:21:32 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv19775
Modified Files:
Tag: release22-maint
test_descr.py
Log Message:
Add testcase for SF 742911.
Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113.4.30
retrieving revision 1.113.4.31
diff -C2 -d -r1.113.4.30 -r1.113.4.31
*** test_descr.py 13 Jan 2003 20:17:13 -0000 1.113.4.30
--- test_descr.py 29 May 2003 14:21:29 -0000 1.113.4.31
***************
*** 3145,3148 ****
--- 3145,3171 ----
veris(type(C.__dict__), type(B.__dict__))
+ def weakref_segfault():
+ # SF 742911
+ if verbose:
+ print "Testing weakref segfault..."
+
+ import weakref
+
+ class Provoker:
+ def __init__(self, referrent):
+ self.ref = weakref.ref(referrent)
+
+ def __del__(self):
+ x = self.ref()
+ print x
+ return x
+
+ class Oops(object):
+ pass
+
+ o = Oops()
+ o.whatever = Provoker(o)
+ del o
+
def test_main():
***************
*** 3210,3213 ****
--- 3233,3237 ----
subclass_right_op()
dict_type_with_metaclass()
+ weakref_segfault()
if verbose: print "All OK"