From 61a7c1e20a6c6cbdbd23fdd20611075fe3147176 Mon Sep 17 00:00:00 2001 From: Erez Sh Date: Sat, 8 Aug 2020 15:43:20 +0300 Subject: [PATCH] Removed code that causes failure in Python 3.4 --- lark/exceptions.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lark/exceptions.py b/lark/exceptions.py index 033275c..645b09c 100644 --- a/lark/exceptions.py +++ b/lark/exceptions.py @@ -72,11 +72,7 @@ class UnexpectedInput(LarkError): class UnexpectedCharacters(LexError, UnexpectedInput): def __init__(self, seq, lex_pos, line, column, allowed=None, considered_tokens=None, state=None, token_history=None): - - if isinstance(seq, bytes): - message = "No terminal defined for '%s' at line %d col %d" % (seq[lex_pos:lex_pos+1].decode("ascii", "backslashreplace"), line, column) - else: - message = "No terminal defined for '%s' at line %d col %d" % (seq[lex_pos], line, column) + message = "No terminal defined for '%s' at line %d col %d" % (seq[lex_pos], line, column) self.line = line self.column = column