diff --git a/pytools/lex.py b/pytools/lex.py index 2ad9cee47e6800c7477692cae9408300e7768749..ff9d8a86e645e82f23636abd3eaf79d07c16746e 100644 --- a/pytools/lex.py +++ b/pytools/lex.py @@ -148,8 +148,8 @@ class LexIterator(object): def raise_parse_error(self, msg): if self.is_at_end(): raise ParseError(msg, self.raw_string, None) - else: - raise ParseError(msg, self.raw_string, self.lexed[self.index]) + + raise ParseError(msg, self.raw_string, self.lexed[self.index]) def expected(self, what_expected): if self.is_at_end():