Skip to content

Commit 4ef9ca7

Browse files
committed
[GR-11925] Add missing newline to parse single statements
PullRequest: graalpython/240
2 parents 62faf39 + 3d6f09c commit 4ef9ca7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public int readEvalPrint(Context context, ConsoleHandler consoleHandler) {
531531
}
532532

533533
String continuePrompt = null;
534-
StringBuilder sb = new StringBuilder(input);
534+
StringBuilder sb = new StringBuilder(input).append('\n');
535535
while (true) { // processing subsequent lines while input is incomplete
536536
lastStatus = 0;
537537
try {
@@ -547,8 +547,7 @@ public int readEvalPrint(Context context, ConsoleHandler consoleHandler) {
547547
if (additionalInput == null) {
548548
throw new EOFException();
549549
}
550-
sb.append('\n');
551-
sb.append(additionalInput);
550+
sb.append(additionalInput).append('\n');
552551
// The only continuation in the while loop
553552
continue;
554553
} else if (e.isExit()) {

0 commit comments

Comments
 (0)