From: Michael W. Hudson Date: Tue, 5 Mar 2002 13:58:42 +0000 (+0000) Subject: backport gvanrossum's checkin of X-Git-Tag: v2.2.1c1~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=234bb740f71381a8086818f56a5b92f9155d4fe1;p=thirdparty%2FPython%2Fcpython.git 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). --- diff --git a/Lib/copy.py b/Lib/copy.py index 86fc978e71a3..cf0b1af36712 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -197,7 +197,10 @@ try: d[types.UnicodeType] = _deepcopy_atomic except AttributeError: pass -d[types.CodeType] = _deepcopy_atomic +try: + d[types.CodeType] = _deepcopy_atomic +except AttributeError: + pass d[types.TypeType] = _deepcopy_atomic d[types.XRangeType] = _deepcopy_atomic