From 11d007888c07c8c6639bc8e9de55cd6b63fe8fd8 Mon Sep 17 00:00:00 2001 From: Daniel Morrison Date: Sun, 16 Nov 2014 08:35:43 -0500 Subject: [PATCH] Remove unused code. None of this code was hit under the unittest. Hopefully obsolete. --- entei.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/entei.py b/entei.py index 8679773..ff9b944 100755 --- a/entei.py +++ b/entei.py @@ -217,14 +217,11 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', '>': '>', } - try: - # & must be handled first - string = string.replace('&', '&') - for char in html_codes: - string = string.replace(char, html_codes[char]) - return string - except TypeError: - return '' + # & must be handled first + string = string.replace('&', '&') + 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__': -- 2.47.3