From 2fff84d892da63ce3b67132b33a528d6035e417a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 25 Jan 1999 21:37:02 +0000 Subject: [PATCH] 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 b481d29db7f..2d9de3cad35 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -85,7 +85,10 @@ def _copy_atomic(x): 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