From 2189df1ae72569dfe16b8063af536ffe7ce88f7c Mon Sep 17 00:00:00 2001 From: noah morrison Date: Fri, 7 Nov 2014 22:00:38 -0500 Subject: [PATCH] Fixed IndexError on scopes If there are no scopes it defaults to None --- entei.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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': -- 2.47.3