Commit c90a82fd by Michael DeHaan

Handle possible scenario where conditional might be an integer (whoa!) down the…

Handle possible scenario where conditional might be an integer (whoa!) down the error path.  Super rare but fixes #4483.
parent a956c201
......@@ -175,7 +175,7 @@ def check_conditional(conditional, basedir, inject, fail_on_undefined=False, jin
if conditional in inject and str(inject[conditional]).find('-') == -1:
conditional = inject[conditional]
conditional = template.template(basedir, conditional, inject, fail_on_undefined=fail_on_undefined)
original = conditional.replace("jinja2_compare ","")
original = str(conditional).replace("jinja2_compare ","")
# a Jinja2 evaluation that results in something Python can eval!
presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional
conditional = template.template(basedir, presented, inject)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment