Correct exitcode of KeyboardInterrupt

This commit is contained in:
Moreal committed 2023-01-08 14:49:51 +09:00
1 parent b6c9882e1a
commit 16579aeafe
1 file changed
+13
+13
View File
@@ -757,6 +757,19 @@ impl VirtualMachine {
writeln!(stderr, "{msg}");
}
1
} else if exc.fast_isinstance(self.ctx.exceptions.keyboard_interrupt) {
#[allow(clippy::if_same_then_else)]
{
self.print_exception(exc);
#[cfg(unix)]
{
(libc::SIGINT as u8) + 128u8
}
#[cfg(not(unix))]
{
1
}
}
} else {
self.print_exception(exc);
1