[ZPT] CVS: Releases/Zope/lib/python/Products/PageTemplates - Expressions.py:1.26 TALES.py:1.25

Evan Simpson evan@zope.com
Mon, 10 Dec 2001 10:44:12 -0500


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

Modified Files:
	Expressions.py TALES.py 
Log Message:
Merge fix from 2.5 branch


=== Releases/Zope/lib/python/Products/PageTemplates/Expressions.py 1.25 => 1.26 ===
         vars = econtext.vars
         exists = 0
+        more_paths = len(self._paths)
         for base, path, dp in self._paths:
+            more_paths = more_paths - 1
             # Expand dynamic path parts from right to left.
             if dp:
                 path = list(path) # Copy!
@@ -135,11 +137,13 @@
                     ob = restrictedTraverse(ob, path, securityManager)
                 exists = 1
                 break
-            except Undefined, e:
-                ob = e
+            except Undefined:
+                if not more_paths:
+                    raise
             except (AttributeError, KeyError, TypeError, IndexError,
                     Unauthorized), e:
-                ob = Undefined(self._s, sys.exc_info())
+                if not more_paths:
+                    raise Undefined(self._s, sys.exc_info())
 
         if self._name == 'exists':
             # All we wanted to know is whether one of the paths exist.


=== Releases/Zope/lib/python/Products/PageTemplates/TALES.py 1.24 => 1.25 ===
         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