[Python-checkins] r74569 - in python/trunk/Lib: new.py types.py
benjamin.peterson
python-checkins at python.org
Fri Aug 28 18:48:04 CEST 2009
Author: benjamin.peterson
Date: Fri Aug 28 18:48:03 2009
New Revision: 74569
Log:
restricted environments are no more
Modified:
python/trunk/Lib/new.py
python/trunk/Lib/types.py
Modified: python/trunk/Lib/new.py
==============================================================================
--- python/trunk/Lib/new.py (original)
+++ python/trunk/Lib/new.py Fri Aug 28 18:48:03 2009
@@ -14,8 +14,4 @@
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
Modified: python/trunk/Lib/types.py
==============================================================================
--- python/trunk/Lib/types.py (original)
+++ python/trunk/Lib/types.py Fri Aug 28 18:48:03 2009
@@ -42,11 +42,7 @@
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
More information about the Python-checkins
mailing list