From 37507917e58b731e12dcbefd8e7a8f99aa631a83 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Fri, 4 Mar 2011 14:32:13 +0000
Subject: [PATCH] Get the CompilerError exception properly as in
 TALESConstraint document

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43981 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Utils.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py
index 34d95cec47..9dfdb23207 100644
--- a/product/ERP5Type/Utils.py
+++ b/product/ERP5Type/Utils.py
@@ -1280,12 +1280,9 @@ def createExpressionContext(object, portal=None):
   tv[cache_key] = ec
   return ec
 
-# 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
+# This gets the CompilerError class wherever it is defined (which is
+# different depending on the Zope version)
+CompilerError = getEngine().getCompilerError()
 
 def evaluateExpressionFromString(expression_context, expression_string):
   """
-- 
2.30.9