Visitar URL original
bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module by graingert · Pull Request #21956 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reset _Py_UnhandledKeyboardInterrupt before calling runpy._run_module…
…_as_main
  • Loading branch information
graingert committed Sep 22, 2020
commit 4486dcd7f60eb70987d88dc65f838dfe97fe76c7
1 change: 1 addition & 0 deletions Modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ 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) {
Comment thread
gvanrossum marked this conversation as resolved.
_Py_UnhandledKeyboardInterrupt = 1;
Expand Down