debugger skips two internal frames now
authorArmin Ronacher <armin.ronacher@active-4.com>
Wed, 16 Apr 2008 21:15:15 +0000 (23:15 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Wed, 16 Apr 2008 21:15:15 +0000 (23:15 +0200)
--HG--
branch : trunk

jinja2/debug.py

index 02b6177089a01b294335eda55f1a7d5a82161e0e..ecd84ae42be523ae4d0306cbda9f704474e66373 100644 (file)
@@ -17,7 +17,7 @@ def translate_exception(exc_info):
     all the way down to the correct line numbers and frames.
     """
     result_tb = prev_tb = None
-    initial_tb = tb = exc_info[2]
+    initial_tb = tb = exc_info[2].tb_next
 
     while tb is not None:
         template = tb.tb_frame.f_globals.get('__jinja_template__')
@@ -65,7 +65,9 @@ def fake_exc_info(exc_info, filename, lineno, tb_back=None):
             tb_set_next(tb_back, exc_info[2])
         if tb is not None:
             tb_set_next(exc_info[2].tb_next, tb.tb_next)
-    return exc_info
+
+    # return without this frame
+    return exc_info[:2] + (exc_info[2].tb_next,)
 
 
 def _init_ugly_crap():