From: Benjamin Peterson Date: Fri, 28 Aug 2009 16:48:03 +0000 (+0000) Subject: restricted environments are no more X-Git-Tag: v2.7a1~614 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6348f45899090f63e534d6772c98c67693bb774;p=python restricted environments are no more --- diff --git a/Lib/new.py b/Lib/new.py index e5f964f87e..2a6e631552 100644 --- a/Lib/new.py +++ b/Lib/new.py @@ -14,8 +14,4 @@ from types import InstanceType as instance from types import MethodType as instancemethod from types import ModuleType as module -# CodeType is not accessible in restricted execution mode -try: - from types import CodeType as code -except ImportError: - pass +from types import CodeType as code diff --git a/Lib/types.py b/Lib/types.py index ea316fa327..39ad488981 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -42,11 +42,7 @@ DictType = DictionaryType = dict def _f(): pass FunctionType = type(_f) LambdaType = type(lambda: None) # Same as FunctionType -try: - CodeType = type(_f.func_code) -except RuntimeError: - # Execution in restricted environment - pass +CodeType = type(_f.func_code) def _g(): yield 1