From 82d7bcd1d55630ea03c8cf6ffd12bad286e702f2 Mon Sep 17 00:00:00 2001 From: noah morrison Date: Fri, 31 Oct 2014 15:06:52 -0400 Subject: [PATCH] Removed unnecessary custome exception The custome exception EOF was not needed, there is a built-in one called EOFError. --- chevron.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 -- 2.47.3