]> Devi Nivas Git - chevron.git/commitdiff
get_key now defaults to ''
authornoah morrison <noah@morrison.ph>
Sat, 8 Nov 2014 02:59:08 +0000 (21:59 -0500)
committernoah morrison <noah@morrison.ph>
Sat, 8 Nov 2014 02:59:08 +0000 (21:59 -0500)
Instead of return None, get_key now returns an empty string.

Also wrapped get_key calls in str

entei.py

index 4a85755255d91240ad1262e67b892bcae5c42324..3a3414d5e284135899ff0007aea6261f7d849c3e 100755 (executable)
--- a/entei.py
+++ b/entei.py
@@ -171,6 +171,7 @@ def render(template, data, partials_path='.', partials_ext='mustache',
                 return scope
             except (TypeError, KeyError):
                 pass
+        return ''
 
     def get_partial(name):
         try:
@@ -201,10 +202,10 @@ def render(template, data, partials_path='.', partials_ext='mustache',
             output += key
 
         elif tag == 'variable':
-            output += html_escape(get_key(key))
+            output += html_escape(str(get_key(key)))
 
         elif tag == 'no escape':
-            output += get_key(key)
+            output += str(get_key(key))
 
         elif tag == 'section':
             scope = get_key(key)