Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved support for KeyboardInterrupts #20961

Merged
merged 13 commits into from
Jan 29, 2025
Merged
Prev Previous commit
Next Next commit
fmt
orlp committed Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d22b97c184364bab62fc0b0f1419065ab1d0af61
8 changes: 3 additions & 5 deletions crates/polars-error/src/signals.rs
Original file line number Diff line number Diff line change
@@ -63,11 +63,9 @@ pub fn catch_keyboard_interrupt<R, F: FnOnce() -> R + UnwindSafe>(
try_register_catcher()?;
let ret = catch_unwind(try_fn);
unregister_catcher();
ret.map_err(|p| {
match p.downcast::<KeyboardInterrupt>() {
Ok(_) => KeyboardInterrupt,
Err(p) => std::panic::resume_unwind(p),
}
ret.map_err(|p| match p.downcast::<KeyboardInterrupt>() {
Ok(_) => KeyboardInterrupt,
Err(p) => std::panic::resume_unwind(p),
})
}

1 change: 0 additions & 1 deletion crates/polars-stream/src/async_executor/task.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ use std::task::{Context, Poll, Wake, Waker};

use atomic_waker::AtomicWaker;
use parking_lot::Mutex;

use polars_error::signals::try_raise_keyboard_interrupt;

/// The state of the task. Can't be part of the TaskData enum as it needs to be