[ZPT] CVS: Products/PageTemplates - Expressions.py:1.27 ZopePageTemplate.py:1.29
Tres Seaver
tseaver@zope.com
Mon, 10 Dec 2001 19:48:46 -0500
Update of /cvs-repository/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv5844
Modified Files:
Expressions.py ZopePageTemplate.py
Log Message:
- Work around absence of named Unauthorized exception in Zope 2.3x
=== Products/PageTemplates/Expressions.py 1.26 => 1.27 ===
if sys.modules.has_key('Zope'):
import AccessControl
- from AccessControl import getSecurityManager, Unauthorized
+ from AccessControl import getSecurityManager
+ try:
+ from AccessControl import Unauthorized
+ except ImportError:
+ Unauthorized = "Unauthorized"
if hasattr(AccessControl, 'full_read_guard'):
from ZRPythonExpr import PythonExpr, _SecureModuleImporter, \
call_with_ns
=== Products/PageTemplates/ZopePageTemplate.py 1.28 => 1.29 ===
from Shared.DC.Scripts.Script import Script, BindingsUI
from Shared.DC.Scripts.Signature import FuncCode
-from AccessControl import getSecurityManager, Unauthorized
+from AccessControl import getSecurityManager
+try:
+ from AccessControl import Unauthorized
+except ImportError:
+ Unauthorized = "Unauthorized"
from OFS.History import Historical, html_diff
from OFS.Cache import Cacheable
from OFS.Traversable import Traversable