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