From: Guido van Rossum Date: Thu, 28 Feb 2002 23:19:52 +0000 (+0000) Subject: SF patch 518765 (Derek Harland): Bug in copy.py when used through X-Git-Tag: v2.3c1~6607 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88b666ca3f2e403d23c05a94fbc8038ad2c1fc4d;p=python 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 86fc978e71..cf0b1af367 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 diff --git a/Misc/ACKS b/Misc/ACKS index 9a49b8628f..51780d87c1 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -176,6 +176,7 @@ Milton L. Hankins Stephen Hansen Barry Hantman Lynda Hardman +Derek Harland Jason Harper Gerhard Häring Larry Hastings