[Zope-Checkins] CVS: Zope/lib/python/RestrictedPython -
Guards.py:1.9.2.2
Fred L. Drake, Jr.
fred at zope.com
Thu Nov 6 10:41:23 EST 2003
Casey Duncan writes:
> 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
...
> -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)
Agh! You ripped out the changes we wanted! I'll fix.
-Fred
--
Fred L. Drake, Jr. <fred at zope.com>
PythonLabs at Zope Corporation
More information about the Zope-Checkins
mailing list