summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbertas Agejevas <alga@pov.lt>2013-02-22 16:26:33 +0000
committerAlbertas Agejevas <alga@pov.lt>2013-02-22 16:26:33 +0000
commit8420caecdcff0d93b0b3ed72242ff5cc7dddb443 (patch)
tree57136f26f1624d0c0be678be2123a73356acf154
parent06c4132348e3daae1150c4e066604446aac4e949 (diff)
downloadzope-pagetemplate-8420caecdcff0d93b0b3ed72242ff5cc7dddb443.tar.gz
Fixup extra.
-rw-r--r--src/zope/pagetemplate/engine.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/zope/pagetemplate/engine.py b/src/zope/pagetemplate/engine.py
index 6974dfb..d74e137 100644
--- a/src/zope/pagetemplate/engine.py
+++ b/src/zope/pagetemplate/engine.py
@@ -314,14 +314,17 @@ class ZopeEngine(ZopeBaseEngine):
ForbiddenAttribute: ('_getframe', <module 'sys' (built-in)>)
The results of Python expressions evaluated by this engine are
- wrapped in security proxies::
+ wrapped in security proxies if the 'untrusted' extra is installed::
>>> r = context.evaluate('python: {12: object()}.values')
- >>> type(r)
- <type 'zope.security._proxy._Proxy'>
- >>> r = context.evaluate('python: {12: object()}.values()[0].__class__')
- >>> type(r)
- <type 'zope.security._proxy._Proxy'>
+ >>> str(type(r).__name__) == (
+ ... '_Proxy' if HAVE_UNTRUSTED else
+ ... 'builtin_function_or_method')
+ True
+
+ >>> r = context.evaluate('python: {12: object()}[12].__class__')
+ >>> str(type(r).__name__) == '_Proxy' or not HAVE_UNTRUSTED
+ True
General path expressions provide objects that are wrapped in
security proxies as well::