Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2fff84d

Browse files
committed
Don't die if CodeType doesn't exist -- ignore the error. This could
happen in restricted mode.
1 parent 7999bfb commit 2fff84d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/copy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ def _copy_atomic(x):
8585
d[types.LongType] = _copy_atomic
8686
d[types.FloatType] = _copy_atomic
8787
d[types.StringType] = _copy_atomic
88-
d[types.CodeType] = _copy_atomic
88+
try:
89+
d[types.CodeType] = _copy_atomic
90+
except AttributeError:
91+
pass
8992
d[types.TypeType] = _copy_atomic
9093
d[types.XRangeType] = _copy_atomic
9194
d[types.ClassType] = _copy_atomic

0 commit comments

Comments
 (0)