]> granicus.if.org Git - python/commitdiff
restricted environments are no more
authorBenjamin Peterson <benjamin@python.org>
Fri, 28 Aug 2009 16:48:03 +0000 (16:48 +0000)
committerBenjamin Peterson <benjamin@python.org>
Fri, 28 Aug 2009 16:48:03 +0000 (16:48 +0000)
Lib/new.py
Lib/types.py

index e5f964f87e007f591be4a4ccda333f0bebe8f943..2a6e63155290629487d8beab52e7296363212efc 100644 (file)
@@ -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
index ea316fa3275d8f8cbb48679b84371fbb3703c305..39ad4889812240b6234a59b65c0c8e65e5b43d0b 100644 (file)
@@ -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