[Python-checkins] python/dist/src/Lib copy.py,1.26,1.27

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 06 Jun 2002 10:41:24 -0700


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

Modified Files:
	copy.py 
Log Message:
Fix from SF patch 565085: copy._reduction doesn't __setstate__.
Straightforward fix.  Will backport to 2.2.  If there's ever a new 2.1
release, this could be backported there too (since it's an issue with
anything that's got both a __reduce__ and a __setstate__).


Index: copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** copy.py	2 Jun 2002 18:55:56 -0000	1.26
--- copy.py	6 Jun 2002 17:41:20 -0000	1.27
***************
*** 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