[Zope-Checkins] CVS: Packages/DocumentTemplate - DT_In.py:1.56

Jeremy Hylton jeremy@zope.com
Mon, 22 Oct 2001 15:48:24 -0400


Update of /cvs-repository/Packages/DocumentTemplate
In directory cvs.zope.org:/tmp/cvs-serv9797

Modified Files:
	DT_In.py 
Log Message:
Don't store the traceback object in a local variable.

This code was correct, because of the outer try/finally that set tb to
None.  This change localizes the handling of the traceback, so that
it's safety can be determined by local inspection.


=== Packages/DocumentTemplate/DT_In.py 1.55 => 1.56 ===
                                 if index==first: pkw['sequence-start']=0
                                 continue
-                            tb = sys.exc_info()[2]
                             raise ValidationError, '(item %s): %s' % (
-                                index, vv), tb
+                                index, vv), sys.exc_info()[2]
                     else:
                         client = sequence[index]
 
@@ -677,7 +676,6 @@
                 result = ''.join(result)
 
         finally:
-            tb = None
             if cache: pop()
             pop()
 
@@ -747,9 +745,8 @@
                                 self.args['skip_unauthorized']):
                                 if index==1: pkw['sequence-start']=0
                                 continue
-                            tb = sys.exc_info()[2]
                             raise ValidationError, '(item %s): %s' % (
-                                index, vv), tb
+                                index, vv), sys.exc_info()[2]
                     else:
                         client = sequence[index]
 
@@ -776,7 +773,6 @@
                 result = ''.join(result)
 
         finally:
-            tb = None
             if cache: pop()
             pop()