Skip to content
Myr

Merge branch '2.9-maintenance'

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

authored by Armin Ronacher · committed by Armin Ronacher · parents 7685ea5, e302252 · Browse files · 3 files+19 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

3 files+19 added−2 removed

  • tests:+10 added−0 removed
  • other:+9 added−2 removed

3 files+19 added−2 removed

modified:jinja2/compiler.py+2 added-2 removed
1032 unmodified lines
1033 self.write('reciter')1034 else:1035 if self.environment.is_async:1036 self.write('auto_aiter(')1037 self.visit(node.iter, loop_frame)1037 self.visit(node.iter, frame)1038 if self.environment.is_async:1039 self.write(')')1040 self.write(' if (')1041 self.visit(node.test, loop_frame)
3 unmodified lines
1045 self.write('reciter')1046 else:1047 if self.environment.is_async and not extended_loop:1048 self.write('auto_aiter(')1049 self.visit(node.iter, loop_frame)1049 self.visit(node.iter, frame)1050 if self.environment.is_async and not extended_loop:1051 self.write(')')10521053 if node.recursive:
566 unmodified lines
modified:tests/test_regression.py+10 added
410 unmodified lines
411412 assert t.module.link_detail('circle', 'Index', '/') == (413 '<p><span class="fa fa-fw fa-circle">'414 '</span><a href="/">Index</a></p>')415416 def test_variable_reuse(self, env):417 t = env.from_string('{% for x in x.y %}{{ x }}{% endfor %}')418 assert t.render(x={'y': [0, 1, 2]}) == '012'419420 t = env.from_string('{% for x in x.y %}{{ loop.index0 }}|{{ x }}{% endfor %}')421 assert t.render(x={'y': [0, 1, 2]}) == '0|01|12|2'422423 t = env.from_string('{% for x in x.y recursive %}{{ x }}{% endfor %}')424 assert t.render(x={'y': [0, 1, 2]}) == '012'
modified:CHANGES+7 added
1 unmodified line
2================34Version 2.9.15-------------6(bugfix release, release date undecided)78- Fixed a regression that caused for loops to not be able to use the same9 variable for the target as well as source iterator. (#640)1011Version 2.9.112-------------13(bugfix release, released on January 7th 2017)1415- Resolved a regression with call block scoping for macros. Nested caller16 blocks that used the same identifiers as outer macros could refer to the
430 unmodified lines