[Python-checkins] python/dist/src/Lib copy.py,1.22.10.2,1.22.10.3
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Thu, 06 Jun 2002 10:55:37 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv24145
Modified Files:
Tag: release22-maint
copy.py
Log Message:
Backport:
Fix from SF patch 565085: copy._reduction doesn't __setstate__.
Straightforward fix.
Index: copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v
retrieving revision 1.22.10.2
retrieving revision 1.22.10.3
diff -C2 -d -r1.22.10.2 -r1.22.10.3
*** copy.py 5 Mar 2002 13:58:42 -0000 1.22.10.2
--- copy.py 6 Jun 2002 17:55:35 -0000 1.22.10.3
***************
*** 302,306 ****
if deep:
state = deepcopy(state, memo)
! y.__dict__.update(state)
return y
--- 302,309 ----
if deep:
state = deepcopy(state, memo)
! if hasattr(y, '__setstate__'):
! y.__setstate__(state)
! else:
! y.__dict__.update(state)
return y