diff --git a/vm/src/vm/mod.rs b/vm/src/vm/mod.rs index 4432255243..17d4c91a2a 100644 --- a/vm/src/vm/mod.rs +++ b/vm/src/vm/mod.rs @@ -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