[Python-checkins] CVS: python/dist/src/Lib copy.py,1.22.10.1,1.22.10.2

Michael Hudson mwh@users.sourceforge.net
Tue, 05 Mar 2002 05:58:45 -0800


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

Modified Files:
      Tag: release22-maint
	copy.py 
Log Message:
backport gvanrossum's checkin of
    revision 1.24 of copy.py

SF patch 518765 (Derek Harland): Bug in copy.py when used through
rexec.

When using a restricted environment, imports of copy will fail with an
AttributeError when trying to access types.CodeType.

Bugfix candidate (all the way back to 1.5.3, but at least 2.1.3 and
2.2.1).


Index: copy.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/copy.py,v
retrieving revision 1.22.10.1
retrieving revision 1.22.10.2
diff -C2 -d -r1.22.10.1 -r1.22.10.2
*** copy.py	4 Jan 2002 12:28:43 -0000	1.22.10.1
--- copy.py	5 Mar 2002 13:58:42 -0000	1.22.10.2
***************
*** 198,202 ****
  except AttributeError:
      pass
! d[types.CodeType] = _deepcopy_atomic
  d[types.TypeType] = _deepcopy_atomic
  d[types.XRangeType] = _deepcopy_atomic
--- 198,205 ----
  except AttributeError:
      pass
! try:
!     d[types.CodeType] = _deepcopy_atomic
! except AttributeError:
!     pass
  d[types.TypeType] = _deepcopy_atomic
  d[types.XRangeType] = _deepcopy_atomic