Commit d6afb5d8 by Toshio Kuratomi

Fix assert to work with unicode values

parent 29809bb8
...@@ -260,10 +260,10 @@ def check_conditional(conditional, basedir, inject, fail_on_undefined=False): ...@@ -260,10 +260,10 @@ def check_conditional(conditional, basedir, inject, fail_on_undefined=False):
conditional = conditional.replace("jinja2_compare ","") conditional = conditional.replace("jinja2_compare ","")
# allow variable names # allow variable names
if conditional in inject and '-' not in str(inject[conditional]): if conditional in inject and '-' not in to_unicode(inject[conditional], nonstring='simplerepr'):
conditional = inject[conditional] conditional = to_unicode(inject[conditional], nonstring='simplerepr')
conditional = template.template(basedir, conditional, inject, fail_on_undefined=fail_on_undefined) conditional = template.template(basedir, conditional, inject, fail_on_undefined=fail_on_undefined)
original = str(conditional).replace("jinja2_compare ","") original = to_unicode(conditional, nonstring='simplerepr').replace("jinja2_compare ","")
# a Jinja2 evaluation that results in something Python can eval! # a Jinja2 evaluation that results in something Python can eval!
presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional
conditional = template.template(basedir, presented, inject) 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