From 5d73e41172fcf147a5653ababb97a3ec1544a947 Mon Sep 17 00:00:00 2001 From: Daniel Morrison Date: Sun, 16 Nov 2014 00:26:16 -0500 Subject: [PATCH] Handle no newline after standalone. --- entei.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entei.py b/entei.py index 7816006..d1bafe3 100755 --- a/entei.py +++ b/entei.py @@ -125,7 +125,10 @@ def tokenize(template): # If we might be a standalone and we aren't a tag that can't # be a standalone if is_standalone and tag_type not in ['variable', 'no escape']: - until, template = template.split('\n', 1) + try: + until, template = template.split('\n', 1) + except ValueError: + until, template = (template, '') # If the stuff to the right of us are spaces if until.isspace() or until == '': -- 2.47.3