[Zope-Checkins] CVS: Zope/lib/python/RestrictedPython - Guards.py:1.9.2.2

Casey Duncan cvs-admin at zope.org
Wed Nov 5 20:36:44 EST 2003


Update of /cvs-repository/Zope/lib/python/RestrictedPython
In directory cvs.zope.org:/tmp/cvs-serv2179

Modified Files:
      Tag: Zope-2_7-branch
	Guards.py 
Log Message:
Merge changes from HEAD


=== Zope/lib/python/RestrictedPython/Guards.py 1.9.2.1 => 1.9.2.2 ===
--- Zope/lib/python/RestrictedPython/Guards.py:1.9.2.1	Wed Nov  5 18:33:42 2003
+++ Zope/lib/python/RestrictedPython/Guards.py	Wed Nov  5 20:36:43 2003
@@ -14,7 +14,6 @@
 
 __version__='$Revision$'[11:-2]
 
-import exceptions
 import new
 
 safe_builtins = {}
@@ -22,12 +21,15 @@
              'len', 'max', 'min', 'oct', 'ord', 'round', 'str', 'pow',
              'apply', 'callable', 'cmp', 'complex', 'isinstance',
              'issubclass', 'long', 'repr', 'range', 'list', 'tuple',
-             'unichr', 'unicode',):
+             'unichr', 'unicode',
+             'Exception', 'True', 'False', 'bool',
+             'ArithmeticError', 'AssertionError', 'AttributeError',
+             'EOFError', 'EnvironmentError', 'FloatingPointError',
+             'IOError', 'ImportError', 'IndexError', 'KeyError',
+             'LookupError', 'NameError', 'OSError', 'OverflowError',
+             'RuntimeError', 'StandardError', 'SyntaxError',
+             'TypeError', 'UnicodeError', 'ValueError', 'ZeroDivisionError',):
     safe_builtins[name] = __builtins__[name]
-
-for name in dir(exceptions):
-    if name[0] != "_":
-        safe_builtins[name] = getattr(exceptions, name)
 
 
 def _full_read_guard(g_attr, g_item):




More information about the Zope-Checkins mailing list