Commit 91134442 authored by Evan Simpson's avatar Evan Simpson

Fix silly bug in Undefined handling

parent f77344bc
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
An implementation of a generic TALES engine An implementation of a generic TALES engine
""" """
__version__='$Revision: 1.7 $'[11:-2] __version__='$Revision: 1.8 $'[11:-2]
import re, sys, ZTUtils import re, sys, ZTUtils
from MultiMapping import MultiMapping from MultiMapping import MultiMapping
...@@ -262,11 +262,14 @@ class Context: ...@@ -262,11 +262,14 @@ class Context:
evaluateValue = evaluate evaluateValue = evaluate
def evaluateBoolean(self, expr): 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): def evaluateText(self, expr):
text = self.evaluate(expr) text = self.evaluate(expr)
if text is not None: if text not in (None, Undefined):
text = str(text) text = str(text)
return text return text
......
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