From: Guido van Rossum Date: Mon, 25 Jan 1999 21:37:02 +0000 (+0000) Subject: Don't die if CodeType doesn't exist -- ignore the error. This could X-Git-Tag: v1.5.2b2~283 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2fff84d892da63ce3b67132b33a528d6035e417a;p=thirdparty%2FPython%2Fcpython.git Don't die if CodeType doesn't exist -- ignore the error. This could happen in restricted mode. --- diff --git a/Lib/copy.py b/Lib/copy.py index b481d29db7f4..2d9de3cad35e 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