[ZPT] CVS: Zope/lib/python/Products/PageTemplates - Expressions.py:1.25.2.2 TALES.py:1.24.2.1

Tres Seaver tseaver@zope.com
Tue, 11 Dec 2001 14:57:03 -0500


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv12066

Modified Files:
      Tag: Zope-2_5-branch
	Expressions.py TALES.py 
Log Message:


  - Suppress raise of Undefined when the expression is an 'exists:'.
    
  - Stash referenced object, rather than bound method, as local value
    for iterator.



=== Zope/lib/python/Products/PageTemplates/Expressions.py 1.25.2.1 => 1.25.2.2 ===
                 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':


=== Zope/lib/python/Products/PageTemplates/TALES.py 1.24 => 1.24.2.1 ===
         try:
             if ZTUtils.Iterator.next(self):
-                self._context.setLocal(self.name, self.seq[self.index])
+                self._context.setLocal(self.name, self.item())
                 return 1
         except TALESError:
             raise