Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module#21956
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ec2856c78ba11cce4601aa42916bc483f65e37a82ade652940b325b64486dcd714ad5a19f40f7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| Add tests for SIGINT handling in the runpy module. | ||||||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
| ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -287,7 +287,11 @@ pymain_run_module(const wchar_t *modname, int set_argv0) | ||
| Py_DECREF(module); | ||
| return pymain_exit_err_print(); | ||
| } | ||
| _Py_UnhandledKeyboardInterrupt = 0; | ||
| result = PyObject_Call(runmodule, runargs, NULL); | ||
| if (!result && PyErr_Occurred() == PyExc_KeyboardInterrupt) { | ||
gvanrossum marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| _Py_UnhandledKeyboardInterrupt = 1; | ||
| } | ||
| Py_DECREF(runpy); | ||
| Py_DECREF(runmodule); | ||
| Py_DECREF(module); | ||
Uh oh!
There was an error while loading. Please reload this page.