Skip to content

Commit e29fee9

Browse files
committed
If we don't know the reason, just raise invalid syntax to pass more tests.
1 parent d138c42 commit e29fee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/DescriptiveBailErrorListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol,
6363

6464
String entireMessage = String.format("source: %s, line: %s, index: %s, error message: %s %s",
6565
recognizer.getInputStream().getSourceName(), line, charPositionInLine, msg,
66-
e == null ? "<null>" : e.getMessage());
66+
e == null || e.getMessage() == null ? "invalid syntax" : e.getMessage());
6767

6868
if (e != null) {
6969
PIncompleteSourceException handleRecognitionException = handleRecognitionException(e.getExpectedTokens(), entireMessage, e, line);

0 commit comments

Comments
 (0)