Commit b27c3596 authored by Tres Seaver's avatar Tres Seaver

Forward port fixes for collector #1621 and #1894 from the 2.8 branch.

parent b0b56654
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
$Id$ $Id$
""" """
from DocumentTemplate import DT_Util from DocumentTemplate import DT_Util
import SecurityManagement, string, math, whrandom, random import SecurityManagement, string, math, random
import DocumentTemplate.sequence import DocumentTemplate.sequence
from ZopeGuards import safe_builtins from ZopeGuards import safe_builtins
whrandom = random # BBB: will be removed in Zope 2.10
# RestrictedDTML is inserted by AccessControl.Implementation. # RestrictedDTML is inserted by AccessControl.Implementation.
...@@ -27,7 +29,6 @@ from ZopeGuards import safe_builtins ...@@ -27,7 +29,6 @@ from ZopeGuards import safe_builtins
DT_Util.TemplateDict.__allow_access_to_unprotected_subobjects__=1 DT_Util.TemplateDict.__allow_access_to_unprotected_subobjects__=1
string.__allow_access_to_unprotected_subobjects__=1 string.__allow_access_to_unprotected_subobjects__=1
math.__allow_access_to_unprotected_subobjects__=1 math.__allow_access_to_unprotected_subobjects__=1
whrandom.__allow_access_to_unprotected_subobjects__=1
random.__allow_access_to_unprotected_subobjects__=1 random.__allow_access_to_unprotected_subobjects__=1
DocumentTemplate.sequence.__allow_access_to_unprotected_subobjects__=1 DocumentTemplate.sequence.__allow_access_to_unprotected_subobjects__=1
......
...@@ -315,7 +315,10 @@ Python expression support ...@@ -315,7 +315,10 @@ Python expression support
- Special security-aware versions of 'getattr' and 'hasattr', - Special security-aware versions of 'getattr' and 'hasattr',
- The Python 'string', 'math', and 'whrandom' modules, and - The Python 'string', 'math', modules,
- BBB alias for the Python 'whrandom' module (will be removed in
Zope 2.10),
- A special function, 'test', that supports if-then expressions. - A special function, 'test', that supports if-then expressions.
The 'test' function accepts any number of arguments. If the The 'test' function accepts any number of arguments. If the
......
...@@ -54,7 +54,10 @@ class PythonScript: ...@@ -54,7 +54,10 @@ class PythonScript:
o math o math
o whrandom and random o random
o whrandom (deprecated in Python; aliased BBB support will be
removed in Zope 2.10).
o Products.PythonScripts.standard o Products.PythonScripts.standard
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
import string, math, random, whrandom import string, math, random
import DocumentTemplate.sequence import DocumentTemplate.sequence
from DateTime.DateTime import DateTime from DateTime.DateTime import DateTime
...@@ -22,7 +22,7 @@ utility_builtins = {} ...@@ -22,7 +22,7 @@ utility_builtins = {}
utility_builtins['string'] = string utility_builtins['string'] = string
utility_builtins['math'] = math utility_builtins['math'] = math
utility_builtins['random'] = random utility_builtins['random'] = random
utility_builtins['whrandom'] = whrandom utility_builtins['whrandom'] = random # BBB: will be removed in Zope 2.10
utility_builtins['sequence'] = DocumentTemplate.sequence utility_builtins['sequence'] = DocumentTemplate.sequence
utility_builtins['DateTime'] = DateTime utility_builtins['DateTime'] = DateTime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment