]> granicus.if.org Git - python/commitdiff
SF patch 518765 (Derek Harland): Bug in copy.py when used through
authorGuido van Rossum <guido@python.org>
Thu, 28 Feb 2002 23:19:52 +0000 (23:19 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 28 Feb 2002 23:19:52 +0000 (23:19 +0000)
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).

Lib/copy.py
Misc/ACKS

index 86fc978e71a3bf713544a27a76ccc79f1e30c1b3..cf0b1af36712203d31ce94d80798bcc360cc6fe7 100644 (file)
@@ -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
 
index 9a49b8628f4d2c3aa6a1c0f90461712d9c2f32fe..51780d87c1b92c6fdf204b3816963a030999f5c5 100644 (file)
--- 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