From 3f4eb2123418226f8628ada06a469611e78573c3 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Jan 2017 01:37:35 +0100 Subject: [PATCH] Clarified for else todo --- jinja2/compiler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.2