From: Armin Ronacher Date: Mon, 2 Jan 2017 16:10:18 +0000 (+0100) Subject: Changed behavior of local extraction X-Git-Tag: 2.9~30^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd32b37dd35588f0ff8fca5532e76239f13c5273;p=thirdparty%2Fjinja.git Changed behavior of local extraction --- diff --git a/jinja2/debug.py b/jinja2/debug.py index 59e221cd..f0eb79e4 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -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) diff --git a/tests/test_debug.py b/tests/test_debug.py index afcd8265..2303da99 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -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}