From: Daniel Morrison Date: Sun, 16 Nov 2014 05:26:16 +0000 (-0500) Subject: Handle no newline after standalone. X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=5d73e41172fcf147a5653ababb97a3ec1544a947;p=chevron.git Handle no newline after standalone. --- 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 == '':