summaryrefslogtreecommitdiff
path: root/Lib/copy.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-02-28 23:19:52 +0000
committerGuido van Rossum <guido@python.org>2002-02-28 23:19:52 +0000
commit88b666ca3f2e403d23c05a94fbc8038ad2c1fc4d (patch)
tree1f8e7bf3507922687e18bbc774a6c11e4a1f3e71 /Lib/copy.py
parente64ef931d6e4ee800fcd156b28269569d989783c (diff)
downloadcpython-git-88b666ca3f2e403d23c05a94fbc8038ad2c1fc4d.tar.gz
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).
Diffstat (limited to 'Lib/copy.py')
-rw-r--r--Lib/copy.py5
1 files changed, 4 insertions, 1 deletions
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