[ZPT] [Patch]: NameError "CompilerError"

Dieter Maurer dieter@handshake.de
Wed, 18 Jul 2001 22:26:00 +0200 (CEST)


--eHc+uPsSy/
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

Attached is a patch to fix the "NameError 'CompilerError'" exception
that makes finding problems in ZPT's a nightmare.

Apparently, it seems, that some TALES expressions
(at least some "python:" expressions) may not cross line boundaries.
Without the patch, they raise "NameError 'CompilerError'".
With the patch, they raise "SyntaxError" at the end of the
first line.
I did not want to believe this....


Dieter

--eHc+uPsSy/
Content-Type: text/plain
Content-Description: Patch for "NameError 'CompilerError'" exception
Content-Disposition: inline;
	filename="zpt-CompError.pat"
Content-Transfer-Encoding: 7bit

--- PageTemplates/:ZPythonExpr.py	Fri May 25 16:37:21 2001
+++ PageTemplates/ZPythonExpr.py	Wed Jul 18 22:10:19 2001
@@ -95,6 +95,7 @@
 from Products.PythonScripts.Guarded import _marker, \
      GuardedBlock, theGuard, safebin, WriteGuard, ReadGuard, UntupleFunction
 from string import strip, split, join, replace, lstrip
+from TALES import CompilerError
 
 from PythonExpr import PythonExpr
 

--eHc+uPsSy/--