Commit a29aa7ba authored by Arnaud Fontaine's avatar Arnaud Fontaine

CompilerError used to be defined in Products.PageTemplates.TALES in

Zope 2.8, so try to import it first and fallback on zope.tales.tales
for Zope 2.12.

This fixes failures of testDynamicClassGeneration on Zope 2.8.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43957 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a276445e
...@@ -1280,7 +1280,12 @@ def createExpressionContext(object, portal=None): ...@@ -1280,7 +1280,12 @@ def createExpressionContext(object, portal=None):
tv[cache_key] = ec tv[cache_key] = ec
return ec return ec
from zope.tales.tales import CompilerError # CompilerError used to be defined in Products.PageTemplates.TALES in
# Zope 2.8
try:
from Products.PageTemplates.TALES import CompilerError
except ImportError:
from zope.tales.tales import CompilerError
def evaluateExpressionFromString(expression_context, expression_string): def evaluateExpressionFromString(expression_context, expression_string):
""" """
......
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