<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -162,7 +162,7 @@ $def dicttable_items(items, kls='req', id=None):
 $for frame in frames:
     &lt;li class=&quot;frame&quot;&gt;
     &lt;code&gt;$frame.filename&lt;/code&gt; in &lt;code&gt;$frame.function&lt;/code&gt;
-    $if frame.context_line:
+    $if frame.context_line is not None:
         &lt;div class=&quot;context&quot; id=&quot;c$frame.id&quot;&gt;
         $if frame.pre_context:
             &lt;ol start=&quot;$frame.pre_context_lineno&quot; class=&quot;pre-context&quot; id=&quot;pre$frame.id&quot;&gt;
@@ -245,7 +245,7 @@ def djangoerror():
                 [line.strip('\n') for line in source[lineno + 1:upper_bound]]
 
             return lower_bound, pre_context, context_line, post_context
-        except (OSError, IOError):
+        except (OSError, IOError, IndexError):
             return None, [], None, []    
     
     exception_type, exception_value, tback = sys.exc_info()
@@ -256,18 +256,20 @@ def djangoerror():
         lineno = tback.tb_lineno - 1
         pre_context_lineno, pre_context, context_line, post_context = \
             _get_lines_from_file(filename, lineno, 7)
-        frames.append(web.storage({
-            'tback': tback,
-            'filename': filename,
-            'function': function,
-            'lineno': lineno,
-            'vars': tback.tb_frame.f_locals,
-            'id': id(tback),
-            'pre_context': pre_context,
-            'context_line': context_line,
-            'post_context': post_context,
-            'pre_context_lineno': pre_context_lineno,
-        }))
+
+        if '__hidetraceback__' not in tback.tb_frame.f_locals:
+            frames.append(web.storage({
+                'tback': tback,
+                'filename': filename,
+                'function': function,
+                'lineno': lineno,
+                'vars': tback.tb_frame.f_locals,
+                'id': id(tback),
+                'pre_context': pre_context,
+                'context_line': context_line,
+                'post_context': post_context,
+                'pre_context_lineno': pre_context_lineno,
+            }))
         tback = tback.tb_next
     frames.reverse()
     urljoin = urlparse.urljoin</diff>
      <filename>web/debugerror.py</filename>
    </modified>
    <modified>
      <diff>@@ -777,11 +777,13 @@ class BaseTemplate:
         return env['wrapper']
 
     def __call__(self, *a, **kw):
+        __hidetraceback__ = True
         t = self.t()
         out = t(*a, **kw)
         return self._join_output(out)
         
     def _join_output(self, out):
+        __hidetraceback__ = True
         d = TemplateResult()
         data = []
         
@@ -862,6 +864,7 @@ class Template(BaseTemplate):
     normalize_text = staticmethod(normalize_text)
                 
     def __call__(self, *a, **kw):
+        __hidetraceback__ = True
         import webapi as web
         if 'headers' in web.ctx and self.content_type:
             web.header('Content-Type', self.content_type, unique=True)</diff>
      <filename>web/template.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5dd4292d4faa73188a0b52bef57b806a086f6770</id>
    </parent>
  </parents>
  <author>
    <name>Anand Chitipothu</name>
    <email>anandology@gmail.com</email>
  </author>
  <url>http://github.com/webpy/webpy/commit/6561539075bb854f4edc3e8e9e17c982645f1e44</url>
  <id>6561539075bb854f4edc3e8e9e17c982645f1e44</id>
  <committed-date>2009-11-07T00:20:47-08:00</committed-date>
  <authored-date>2009-11-07T00:20:47-08:00</authored-date>
  <message>hide unwanted tracebacks in debugerror (idea from py.test)</message>
  <tree>c68108057f3e9da5ebd719608c7b49a9b893afe6</tree>
  <committer>
    <name>Anand Chitipothu</name>
    <email>anandology@gmail.com</email>
  </committer>
</commit>
