]> Devi Nivas Git - chevron.git/commitdiff
Remove unused code.
authorDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 13:35:43 +0000 (08:35 -0500)
committerDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 13:35:43 +0000 (08:35 -0500)
None of this code was hit under the unittest.
Hopefully obsolete.

entei.py

index 8679773b2a7853ba6041fdfffd19c5ce9ae8039f..ff9b944b44bb623f6e21de86af19c293d1883348 100755 (executable)
--- a/entei.py
+++ b/entei.py
@@ -217,14 +217,11 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache',
             '>': '&gt;',
         }
 
-        try:
-            # & must be handled first
-            string = string.replace('&', '&amp;')
-            for char in html_codes:
-                string = string.replace(char, html_codes[char])
-            return string
-        except TypeError:
-            return ''
+        # & must be handled first
+        string = string.replace('&', '&amp;')
+        for char in html_codes:
+            string = string.replace(char, html_codes[char])
+        return string
 
     def get_key(key):
         """Get a key from the current scope"""
@@ -287,10 +284,7 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache',
     # Run through the tokens
     for tag, key in tokens:
         # Set the current scope
-        try:
-            current_scope = scopes[0]
-        except IndexError:
-            current_scope = None
+        current_scope = scopes[0]
 
         # If we're an end tag
         if tag == 'end':
@@ -380,10 +374,6 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache',
             # Add the partials output to the ouput
             output += part_out
 
-        else:
-            # This should never get hit
-            print('UNKNOWN TAG:', tag)
-
     return output
 
 if __name__ == '__main__':