[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.113,1.114
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 28 Dec 2001 13:39:05 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv31033
Modified Files:
test_descr.py
Log Message:
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.114
diff -C2 -d -r1.113 -r1.114
*** test_descr.py 2001/12/14 04:19:56 1.113
--- test_descr.py 2001/12/28 21:39:03 1.114
***************
*** 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"