From: noah morrison Date: Fri, 31 Oct 2014 19:06:52 +0000 (-0400) Subject: Removed unnecessary custome exception X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=82d7bcd1d55630ea03c8cf6ffd12bad286e702f2;p=chevron.git Removed unnecessary custome exception The custome exception EOF was not needed, there is a built-in one called EOFError. --- diff --git a/chevron.py b/chevron.py index 053c510..7bd588d 100755 --- a/chevron.py +++ b/chevron.py @@ -4,9 +4,6 @@ import sys def tokenize(template): - class EOF(Exception): - pass - class UnclosedSection(Exception): pass @@ -16,7 +13,7 @@ def tokenize(template): def look(ahead=0, amount=1): idx = current + ahead if idx > len(template): - raise EOF() + raise EOFError() return template[idx:idx + amount] @@ -40,7 +37,7 @@ def tokenize(template): size = 0 while look(size, 2) != l_del: size += 1 - except EOF: + except EOFError: yield ('literal', get(size)) return