From: noah morrison Date: Fri, 23 Jan 2015 02:59:10 +0000 (-0500) Subject: Fix unicode inside of lists for python 2 X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=1ad1987b589a53f653f10e8dd232514ffb24cafd;p=chevron.git Fix unicode inside of lists for python 2 --- diff --git a/chevron/renderer.py b/chevron/renderer.py index 9f03736..c5dea30 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -217,11 +217,16 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', for thing in scope: # Append it as the most recent scope and render new_scope = [thing] + scopes - output += render(template=tags, scopes=new_scope, - partials_path=partials_path, - partials_ext=partials_ext, - partials_dict=partials_dict, - def_ldel=def_ldel, def_rdel=def_rdel) + rend = render(template=tags, scopes=new_scope, + partials_path=partials_path, + partials_ext=partials_ext, + partials_dict=partials_dict, + def_ldel=def_ldel, def_rdel=def_rdel) + + if python3: + output += rend + else: + output += rend.decode('utf-8') else: # Otherwise we're just a scope section