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