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

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 28 Feb 2002 15:19:15 -0800


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

Modified Files:
	copy.py 
Log Message:
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.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** copy.py	28 Dec 2001 21:33:22 -0000	1.23
--- copy.py	28 Feb 2002 23:19:13 -0000	1.24
***************
*** 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