Kaydet (Commit) f6348f45 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

restricted environments are no more

üst 7a7739d7
...@@ -14,8 +14,4 @@ from types import InstanceType as instance ...@@ -14,8 +14,4 @@ from types import InstanceType as instance
from types import MethodType as instancemethod from types import MethodType as instancemethod
from types import ModuleType as module from types import ModuleType as module
# CodeType is not accessible in restricted execution mode from types import CodeType as code
try:
from types import CodeType as code
except ImportError:
pass
...@@ -42,11 +42,7 @@ DictType = DictionaryType = dict ...@@ -42,11 +42,7 @@ DictType = DictionaryType = dict
def _f(): pass def _f(): pass
FunctionType = type(_f) FunctionType = type(_f)
LambdaType = type(lambda: None) # Same as FunctionType LambdaType = type(lambda: None) # Same as FunctionType
try: CodeType = type(_f.func_code)
CodeType = type(_f.func_code)
except RuntimeError:
# Execution in restricted environment
pass
def _g(): def _g():
yield 1 yield 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment