[Zope-Checkins] CVS: Releases/Zope/lib/python/TAL - TALDefs.py:1.24 TALInterpreter.py:1.62

Evan Simpson evan@zope.com
Tue, 23 Oct 2001 15:14:33 -0400


Update of /cvs-repository/Releases/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv10343/TAL

Modified Files:
	TALDefs.py TALInterpreter.py 
Log Message:
Prevent traceback leaks.


=== Releases/Zope/lib/python/TAL/TALDefs.py 1.23 => 1.24 ===
     # This exception can carry around another exception + traceback
 
+    def takeTraceback(self):
+        t = self.info[2]
+        self.info = self.info[:2] + (None,)
+        return t
+
     def __init__(self, msg, position=(None, None), info=(None, None, None)):
         t, v, tb = info
         if t:


=== Releases/Zope/lib/python/TAL/TALInterpreter.py 1.61 => 1.62 ===
             err.lineno, err.offset = self.position
             engine.setLocal('error', err)
-            self.interpret(handler)
-            engine.endScope()
+            try:
+                self.interpret(handler)
+            finally:
+                err.takeTraceback()
+                engine.endScope()
         else:
             self.restoreOutputState(state)
             self.stream_write(stream.getvalue())