]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Changed behavior of local extraction
authorArmin Ronacher <armin.ronacher@active-4.com>
Mon, 2 Jan 2017 16:10:18 +0000 (17:10 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 3 Jan 2017 22:45:29 +0000 (23:45 +0100)
jinja2/debug.py
tests/test_debug.py

index 59e221cda924b0f4d6ec579392aff1c93b53dd11..f0eb79e4f8065593bbc69f12087be054307c2099 100644 (file)
@@ -205,7 +205,7 @@ def get_jinja_locals(real_locals):
     local_overrides = {}
 
     for name, value in iteritems(real_locals):
-        if not name.startswith('l_'):
+        if not name.startswith('l_') or value is missing:
             continue
         _, depth, name = name.split('_', 2)
         depth = int(depth)
index afcd8265df12fa7f9525469ed730ca1a54923918..2303da993297b68c7b6787a4e2b47c0ed657bb92 100644 (file)
@@ -80,6 +80,7 @@ ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero
             'l_1_foo': 23,
             'l_2_foo': 13,
             'l_0_bar': 99,
-            'l_1_bar': missing
+            'l_1_bar': missing,
+            'l_0_baz': missing,
         })
-        assert locals == {'foo': 13}
+        assert locals == {'foo': 13, 'bar': 99}