Skip to content

Correct exitcode of KeyboardInterrupt #4414

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

Merged
merged 1 commit into from
Jan 8, 2023

Conversation

moreal
Copy link
Contributor

@moreal moreal commented Jan 3, 2023

This pull requests fixes exitcode of KeyboardInterrupt. You can run the below code with CPython and RustPython(before/after). (in unix target os)

# RUSTPYTHON
cargo run -- -c "raise KeyboardInterrupt"
echo $?  # before = 1 / after = 130

# CPYTHON
python3 -c "raise KeyboardInterrupt"
echo $?  # 130

Tasks

Related links

vm/src/vm/mod.rs Outdated
self.print_exception(exc);
#[cfg(windows)]
{
winapi::winnt::STATUS_CONTROL_C_EXIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe adding a feature related to winnt will be helpful

@moreal moreal force-pushed the keyboard-int-exitcode branch 6 times, most recently from 83bf3e8 to 2444961 Compare January 8, 2023 05:18
@moreal
Copy link
Contributor Author

moreal commented Jan 8, 2023

I tried to implement for targets (not unix) but there were some issues:

So this pull request became to implement only for unix now. Other pull request will resolve the problem in windows and wasm instead.

@moreal moreal force-pushed the keyboard-int-exitcode branch from 2444961 to 3f98f68 Compare January 8, 2023 05:33
@moreal moreal marked this pull request as ready for review January 8, 2023 05:35
@moreal moreal force-pushed the keyboard-int-exitcode branch from 3f98f68 to 16579ae Compare January 8, 2023 05:49
Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants