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

Evan Simpson evan@zope.com
Mon, 10 Dec 2001 10:41:32 -0500


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

Modified Files:
      Tag: Zope-2_5-branch
	Expressions.py 
Log Message:
Really kill traceback circular references.


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