Skip to content

Commit

Permalink
hack to display correct template line numbers in debugerror
Browse files Browse the repository at this point in the history
  • Loading branch information
anandology committed Nov 7, 2009
1 parent 6561539 commit ed4eba1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/debugerror.py
Expand Up @@ -254,6 +254,11 @@ def _get_lines_from_file(filename, lineno, context_lines):
filename = tback.tb_frame.f_code.co_filename
function = tback.tb_frame.f_code.co_name
lineno = tback.tb_lineno - 1

# hack to get correct line number for templates
if function == "__template__":
lineno -= 2

pre_context_lineno, pre_context, context_line, post_context = \
_get_lines_from_file(filename, lineno, 7)

Expand Down

0 comments on commit ed4eba1

Please sign in to comment.