From 6cc8dd0af8d8b02b8f844ba6674508d263c125a3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 16 Apr 2008 23:15:15 +0200 Subject: [PATCH] debugger skips two internal frames now --HG-- branch : trunk --- jinja2/debug.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jinja2/debug.py b/jinja2/debug.py index 02b6177..ecd84ae 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -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(): -- 2.26.2