Skip to content

Commit 16579ae

Browse files
committed
Correct exitcode of KeyboardInterrupt
1 parent b6c9882 commit 16579ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

vm/src/vm/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,19 @@ impl VirtualMachine {
757757
writeln!(stderr, "{msg}");
758758
}
759759
1
760+
} else if exc.fast_isinstance(self.ctx.exceptions.keyboard_interrupt) {
761+
#[allow(clippy::if_same_then_else)]
762+
{
763+
self.print_exception(exc);
764+
#[cfg(unix)]
765+
{
766+
(libc::SIGINT as u8) + 128u8
767+
}
768+
#[cfg(not(unix))]
769+
{
770+
1
771+
}
772+
}
760773
} else {
761774
self.print_exception(exc);
762775
1

0 commit comments

Comments
 (0)