Commit 661377e7 authored by Tres Seaver's avatar Tres Seaver

  - Suppress raise of Undefined when the expression is an 'exists:'.

  - Stash referenced object, rather than bound method, as local value
    for iterator.
parent cc8e9a87
......@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths.
"""
__version__='$Revision: 1.27 $'[11:-2]
__version__='$Revision: 1.28 $'[11:-2]
import re, sys
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
......@@ -142,11 +142,11 @@ class PathExpr:
exists = 1
break
except Undefined:
if not more_paths:
if self._name != 'exists' and not more_paths:
raise
except (AttributeError, KeyError, TypeError, IndexError,
Unauthorized), e:
if not more_paths:
if self._name != 'exists' and not more_paths:
raise Undefined(self._s, sys.exc_info())
if self._name == 'exists':
......
......@@ -15,7 +15,7 @@
An implementation of a generic TALES engine
"""
__version__='$Revision: 1.25 $'[11:-2]
__version__='$Revision: 1.26 $'[11:-2]
import re, sys, ZTUtils
from MultiMapping import MultiMapping
......@@ -109,7 +109,7 @@ class Iterator(ZTUtils.Iterator):
def next(self):
try:
if ZTUtils.Iterator.next(self):
self._context.setLocal(self.name, self.item)
self._context.setLocal(self.name, self.item())
return 1
except TALESError:
raise
......
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