[Zope-Checkins] CVS: Zope2 - DT_In.py:1.48.4.4

shane@digicool.com shane@digicool.com
Fri, 27 Apr 2001 15:46:24 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/DocumentTemplate
In directory korak:/tmp/cvs-serv14393

Modified Files:
      Tag: RestrictedPythonBranch
	DT_In.py 
Log Message:
Fixed typo and improved tracebacks



--- Updated File DT_In.py in package Zope2 --
--- DT_In.py	2001/04/26 22:25:08	1.48.4.3
+++ DT_In.py	2001/04/27 19:46:22	1.48.4.4
@@ -405,6 +405,7 @@
 __rcs_id__='$Id$'
 __version__='$Revision$'[11:-2]
 
+import sys
 from DT_Util import ParseError, parse_params, name_param, str
 from DT_Util import render_blocks, InstanceDict, ValidationError, Eval
 from string import find, atoi, join, split, lower
@@ -632,8 +633,9 @@
                                 params['skip_unauthorized']):
                                 if index==first: kw['sequence-start']=0
                                 continue
+                            tb = sys.exc_info()[2]
                             raise ValidationError, '(item %s): %s' % (
-                                index, vv)
+                                index, vv), tb
                     else:
                         client = sequence[index]
 
@@ -653,6 +655,7 @@
                 result=join(result, '')
 
         finally:
+            tb = None
             if cache: pop()
             pop()
 
@@ -714,12 +717,13 @@
                     if read_guard is not None:
                         try: client = read_guard(sequence)[index]
                         except ValidationError, vv:
-                            if (params.has_key('skip_unauthorized') and
-                                params['skip_unauthorized']):
-                                if index==first: kw['sequence-start']=0
+                            if (self.args.has_key('skip_unauthorized') and
+                                self.args['skip_unauthorized']):
+                                if index==1: kw['sequence-start']=0
                                 continue
+                            tb = sys.exc_info()[2]
                             raise ValidationError, '(item %s): %s' % (
-                                index, vv)
+                                index, vv), tb
                     else:
                         client = sequence[index]
 
@@ -737,6 +741,7 @@
                 result=join(result, '')
 
         finally:
+            tb = None
             if cache: pop()
             pop()
 
@@ -840,7 +845,6 @@
 def nocase(str1, str2):
     return cmp(lower(str1), lower(str2))
 
-import sys
 if sys.modules.has_key("locale"): # only if locale is already imported
     from locale import strcoll