Skip to content
Myr

Merge pull request #673 from MrSenko/get_corresponding_lineno_traceback

Before adoption: this commit came in with the history the project adopted, so no landing records it.

handle template.get_corresponding_lineno() for lines without debug info

authored by David Lord · committed by GitHub · parents abc6ac8, 432daea · Browse files · 2 files+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−2 removed

  • tests:+4 added−0 removed
  • other:+4 added−2 removed

2 files+8 added−2 removed

modified:jinja2/environment.py+4 added-2 removed
1131 unmodified lines
11321133 @property1134 def debug_info(self):1135 """The debug info mapping."""1136 if self._debug_info:1136 return [tuple(imap(int, x.split('='))) for x in1137 self._debug_info.split('&')]1137 return [tuple(imap(int, x.split('='))) for x in1138 self._debug_info.split('&')]1139 return []11401141 def __repr__(self):1142 if self.name is None:1143 name = 'memory:%x' % id(self)
144 unmodified lines
modified:tests/test_debug.py+4 added
80 unmodified lines
81 'l_1_bar': missing,82 'l_0_baz': missing,83 })84 assert locals == {'foo': 13, 'bar': 99}8586 def test_get_corresponding_lineno_traceback(self, fs_env):87 tmpl = fs_env.get_template('test.html')88 assert tmpl.get_corresponding_lineno(1) == 1