[Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.37, 1.38

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Fri Feb 13 14:22:00 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18952

Modified Files:
	test_weakref.py 
Log Message:
further testing indicates that the simplified version of the test
(re-using an existing test object class) no longer triggered the
original segfault when the fix was backed out; restoring the local
test object class to make the test effective

the assignment of the ref created at the end does not affect the test,
since the segfault happended before weakref.ref() returned; removing
the assignment


Index: test_weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** test_weakref.py	12 Feb 2004 19:30:17 -0000	1.37
--- test_weakref.py	13 Feb 2004 19:21:57 -0000	1.38
***************
*** 603,613 ****
          gc.set_threshold(1, 1, 1)
          gc.collect()
  
          def callback(*args):
              pass
  
!         referenced = C()
  
!         a = C()
          a.a = a
          a.wr = makeref(referenced)
--- 603,615 ----
          gc.set_threshold(1, 1, 1)
          gc.collect()
+         class A:
+             pass
  
          def callback(*args):
              pass
  
!         referenced = A()
  
!         a = A()
          a.a = a
          a.wr = makeref(referenced)
***************
*** 616,621 ****
              # now make sure the object and the ref get labeled as
              # cyclic trash:
!             a = C()
!             a.wrc = weakref.ref(referenced, callback)
  
          finally:
--- 618,623 ----
              # now make sure the object and the ref get labeled as
              # cyclic trash:
!             a = A()
!             weakref.ref(referenced, callback)
  
          finally:




More information about the Python-checkins mailing list