mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Correct exitcode of KeyboardInterrupt
This commit is contained in:
1 parent
b6c9882e1a
commit
16579aeafe
1 file changed
+13
@@ -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
|
||||
|
||||
Reference in new issue
Block a user