Skip to content

Commit c3abf4c

Browse files
committed
fix exit code generation when the code is a boolean
1 parent 21f029c commit c3abf4c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/control/TopLevelExceptionHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ private void handleSystemExit(PException e) {
192192
exitcode = ((PInt) attribute).intValue();
193193
} else if (attribute instanceof PNone) {
194194
exitcode = 0; // "goto done" case in CPython
195+
} else if (attribute instanceof Boolean) {
196+
exitcode = ((boolean)attribute) ? 1 : 0;
195197
}
196198
if (exitcode != null) {
197199
throw new PythonExitException(this, exitcode);

0 commit comments

Comments
 (0)