Browse Source

Ensure that Exceptions with Unicode content display correctly

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
night199uk 7 years ago
parent
commit
d7a6b01d8a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lark/exceptions.py

+ 2
- 2
lark/exceptions.py View File

@@ -66,7 +66,7 @@ class UnexpectedCharacters(LexError, UnexpectedInput):
if allowed:
message += '\nExpecting: %s\n' % allowed

super(UnexpectedCharacters, self).__init__(message)
super(UnexpectedCharacters, self).__init__(message.encode('utf-8'))



@@ -84,6 +84,6 @@ class UnexpectedToken(ParseError, UnexpectedInput):
"Expected one of: \n\t* %s\n"
% (token, self.line, self.column, '\n\t* '.join(self.expected)))

super(UnexpectedToken, self).__init__(message)
super(UnexpectedToken, self).__init__(message.encode('utf-8'))

###}

Loading…
Cancel
Save