diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-08-28 16:48:03 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-08-28 16:48:03 (GMT) |
commit | f6348f45899090f63e534d6772c98c67693bb774 (patch) | |
tree | 843f623a2688df5d7aa7423654aecdc89fb1001c | |
parent | 7a7739d75ed505033445248a126830bedb17101b (diff) | |
download | cpython-f6348f45899090f63e534d6772c98c67693bb774.zip cpython-f6348f45899090f63e534d6772c98c67693bb774.tar.gz cpython-f6348f45899090f63e534d6772c98c67693bb774.tar.bz2 |
restricted environments are no more
-rw-r--r-- | Lib/new.py | 6 | ||||
-rw-r--r-- | Lib/types.py | 6 |
2 files changed, 2 insertions, 10 deletions
@@ -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 ea316fa..39ad488 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 |