From: Armin Ronacher Date: Tue, 3 Jan 2017 00:37:35 +0000 (+0100) Subject: Clarified for else todo X-Git-Tag: 2.9~30^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f4eb2123418226f8628ada06a469611e78573c3;p=thirdparty%2Fjinja.git Clarified for else todo --- diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 03866b52..a7fb325c 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -842,7 +842,8 @@ class CodeGenerator(NodeVisitor): def visit_For(self, node, frame): # TODO: this should really use two frames: one for the loop body - # and a separate one for the loop else block. + # and a separate one for the loop else block. This also is needed + # because the loop variable must not be visible in the else block loop_frame = frame.inner() # try to figure out if we have an extended loop. An extended loop