]> Devi Nivas Git - chevron.git/commitdiff
Handle no newline after standalone.
authorDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 05:26:16 +0000 (00:26 -0500)
committerDaniel Morrison <dan@morrison.ph>
Sun, 16 Nov 2014 05:36:20 +0000 (00:36 -0500)
entei.py

index 7816006066eee13ec5bd364ed8423d1613b9cc16..d1bafe352bfa42e6033f3219665f07f4f9e6c139 100755 (executable)
--- 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 == '':