Don't die if CodeType doesn't exist -- ignore the error. This could

happen in restricted mode.
This commit is contained in:
Guido van Rossum 1999-01-25 21:37:02 +00:00
parent 7999bfb235
commit 2fff84d892
1 changed files with 4 additions and 1 deletions

View File

@ -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