diff --git a/runtime/Python2/src/antlr4/error/ErrorStrategy.py b/runtime/Python2/src/antlr4/error/ErrorStrategy.py index b70c7df8e0..f79cc59c65 100644 --- a/runtime/Python2/src/antlr4/error/ErrorStrategy.py +++ b/runtime/Python2/src/antlr4/error/ErrorStrategy.py @@ -125,7 +125,7 @@ def reportError(self, recognizer, e): self.reportFailedPredicate(recognizer, e) else: print("unknown recognition error type: " + type(e).__name__) - recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e) + recognizer.notifyErrorListeners(e.message, e.getOffendingToken(), e) # # {@inheritDoc} diff --git a/runtime/Python2/src/antlr4/error/Errors.py b/runtime/Python2/src/antlr4/error/Errors.py index 35ac0d10a7..55a3db8bce 100644 --- a/runtime/Python2/src/antlr4/error/Errors.py +++ b/runtime/Python2/src/antlr4/error/Errors.py @@ -79,6 +79,7 @@ def __init__(self, lexer, input, startIndex, deadEndConfigs): super(LexerNoViableAltException, self).__init__(message=None, recognizer=lexer, input=input, ctx=None) self.startIndex = startIndex self.deadEndConfigs = deadEndConfigs + self.message = "" def __unicode__(self): symbol = "" diff --git a/runtime/Python3/src/antlr4/error/Errors.py b/runtime/Python3/src/antlr4/error/Errors.py index e78ac05911..3f34492693 100644 --- a/runtime/Python3/src/antlr4/error/Errors.py +++ b/runtime/Python3/src/antlr4/error/Errors.py @@ -85,6 +85,7 @@ def __init__(self, lexer:Lexer, input:InputStream, startIndex:int, deadEndConfig super().__init__(message=None, recognizer=lexer, input=input, ctx=None) self.startIndex = startIndex self.deadEndConfigs = deadEndConfigs + self.message = "" def __str__(self): symbol = ""