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 0fcf451, ca124c5 · Browse files · 3 files+12 added−0 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+12 added−0 removed

  • tests:+6 added−0 removed
  • other:+6 added−0 removed

3 files+12 added−0 removed

modified:jinja2/compiler.py+3 added
1068 unmodified lines
1069 self.func('loop'), node)1070 self.indent()1071 self.buffer(loop_frame)10721073 # Use the same buffer for the else frame1074 else_frame.buffer = loop_frame.buffer10751076 # make sure the loop variable is a special one and raise a template1077 # assertion error if a loop tries to write to loop1078 if extended_loop:1079 self.writeline('%s = missing' % loop_ref)
617 unmodified lines
modified:tests/test_regression.py+6 added
518 unmodified lines
519 assert x._legacy_resolve_mode520 assert x.resolve_or_missing('foo') == 42521 assert x.resolve_or_missing('bar') == 23522 assert x.resolve_or_missing('baz') is missing523524 def test_recursive_loop_bug(self, env):525 tmpl = env.from_string('''526 {%- for value in values recursive %}1{% else %}0{% endfor -%}527 ''')528 assert tmpl.render(values=[]) == '0'
modified:CHANGES+3 added
18 unmodified lines
19 caused issues with ansible and it was an unintended change. (#654)20- Added back support for custom contexts that override the old `resolve`21 method since it was hard for people to spot that this could cause a22 regression.23- Correctly use the buffer for the else block of for loops. This caused24 invalid syntax errors to be caused on 2.x and completely wrong behavior25 on Python 3 (#669)2627Version 2.9.428-------------29(bugfix release, released on January 10th 2017)
480 unmodified lines