From: noah morrison Date: Sat, 8 Nov 2014 03:00:38 +0000 (-0500) Subject: Fixed IndexError on scopes X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=2189df1ae72569dfe16b8063af536ffe7ce88f7c;p=chevron.git Fixed IndexError on scopes If there are no scopes it defaults to None --- diff --git a/entei.py b/entei.py index 3a3414d..08b9a15 100755 --- a/entei.py +++ b/entei.py @@ -192,10 +192,15 @@ def render(template, data, partials_path='.', partials_ext='mustache', scopes = [data] for tag, key in tokens: + try: + current_scope = scopes[0] + except IndexError: + current_scope = None + if tag == 'end': scopes = scopes[1:] - elif not scopes[0] and len(scopes) != 1: + elif not current_scope and len(scopes) != 1: pass elif tag == 'literal':