]> Devi Nivas Git - chevron.git/commitdiff
Fix unicode inside of lists for python 2
authornoah morrison <noah@morrison.ph>
Fri, 23 Jan 2015 02:59:10 +0000 (21:59 -0500)
committernoah morrison <noah@morrison.ph>
Fri, 23 Jan 2015 02:59:10 +0000 (21:59 -0500)
chevron/renderer.py

index 9f03736077ff2e7e048218052647284fa22d7979..c5dea30e801a1915f514f26bb6fc03e9ba2a9f2b 100644 (file)
@@ -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