[ZPT] CVS: Packages/Products/PageTemplates (Products/DC/PageTemplates) - TALES.py:1.8
evan@serenade.digicool.com
evan@serenade.digicool.com
Tue, 1 May 2001 01:06:04 -0400
Update of /cvs-repository/Packages/Products/PageTemplates
In directory serenade.digicool.com:/home/evan/Zope/pt/lib/python/Products/PageTemplates
Modified Files:
TALES.py
Log Message:
Fix silly bug in Undefined handling
--- Updated File TALES.py in package Packages/Products/PageTemplates --
--- TALES.py 2001/04/27 20:54:27 1.7
+++ TALES.py 2001/05/01 05:06:03 1.8
@@ -262,11 +262,14 @@
evaluateValue = evaluate
def evaluateBoolean(self, expr):
- return not not self.evaluate(expr)
+ bool = self.evaluate(expr)
+ if bool is Undefined:
+ return bool
+ return not not bool
def evaluateText(self, expr):
text = self.evaluate(expr)
- if text is not None:
+ if text not in (None, Undefined):
text = str(text)
return text