From 2fff84d892da63ce3b67132b33a528d6035e417a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 25 Jan 1999 21:37:02 +0000 Subject: Don't die if CodeType doesn't exist -- ignore the error. This could happen in restricted mode. --- Lib/copy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v0.12