summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-25 21:37:02 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-25 21:37:02 (GMT)
commit2fff84d892da63ce3b67132b33a528d6035e417a (patch)
tree98cc1c16962d25dc9c69b0e6e689a54480706997 /Lib
parent7999bfb2357f4dd97555b0b85605f115923faa5d (diff)
downloadcpython-2fff84d892da63ce3b67132b33a528d6035e417a.zip
cpython-2fff84d892da63ce3b67132b33a528d6035e417a.tar.gz
cpython-2fff84d892da63ce3b67132b33a528d6035e417a.tar.bz2
Don't die if CodeType doesn't exist -- ignore the error. This could
happen in restricted mode.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/copy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index b481d29..2d9de3c 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -85,7 +85,10 @@ d[types.IntType] = _copy_atomic
d[types.LongType] = _copy_atomic
d[types.FloatType] = _copy_atomic
d[types.StringType] = _copy_atomic
-d[types.CodeType] = _copy_atomic
+try:
+ d[types.CodeType] = _copy_atomic
+except AttributeError:
+ pass
d[types.TypeType] = _copy_atomic
d[types.XRangeType] = _copy_atomic
d[types.ClassType] = _copy_atomic