Skip to content

Commit 8391bec

Browse files
committed
fix syntax error reporting in interactive shell
1 parent b0eb0e3 commit 8391bec

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/PythonParserImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public Node parse(ParserMode mode, ParserErrorCallback errors, Source source, Fr
7171
throw new RuntimeException("unexpected mode: " + mode);
7272
}
7373
} catch (Exception e) {
74-
if (mode == ParserMode.InteractiveStatement && e instanceof PIncompleteSourceException) {
74+
if ((mode == ParserMode.InteractiveStatement || mode == ParserMode.Statement) && e instanceof PIncompleteSourceException) {
7575
((PIncompleteSourceException) e).setSource(source);
7676
throw e;
7777
} else if (mode == ParserMode.InlineEvaluation) {

0 commit comments

Comments
 (0)