[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.113,1.113.4.1

Michael Hudson mwh@users.sourceforge.net
Fri, 04 Jan 2002 04:28:45 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv11184/test

Modified Files:
      Tag: release22-maint
	test_descr.py 
Log Message:
Backport gvanrossum's  checkin of revisions 
  copy.py, 1.23 & test_descr.py, 1.114:

Fix for SF bug ##497426: can't deepcopy recursive new objects

deepcopy(), _reconstruct(): pass the memo to the other function, so
that recursive data structures built out of new-style objects may be
deeply copied correctly.

2.2.1 bugfix!




Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.113
retrieving revision 1.113.4.1
diff -C2 -d -r1.113 -r1.113.4.1
*** test_descr.py	2001/12/14 04:19:56	1.113
--- test_descr.py	2002/01/04 12:28:43	1.113.4.1
***************
*** 2703,2707 ****
      vereq('%c' % '5', '5')
  
! 
  
  
--- 2703,2715 ----
      vereq('%c' % '5', '5')
  
! def deepcopyrecursive():
!     if verbose: print "Testing deepcopy of recursive objects..."
!     class Node:
!         pass
!     a = Node()
!     b = Node()
!     a.b = b
!     b.a = a
!     z = deepcopy(a) # This blew up before
  
  
***************
*** 2760,2763 ****
--- 2768,2772 ----
      hashinherit()
      strops()
+     deepcopyrecursive()
      if verbose: print "All OK"