Message377022
Thanks, I think this is the fix:
diff --git a/Modules/main.c b/Modules/main.c
index 4a76f4461b..3d1bbee3a0 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -288,6 +288,10 @@ pymain_run_module(const wchar_t *modname, int set_argv0)
return pymain_exit_err_print();
}
result = PyObject_Call(runmodule, runargs, NULL);
+ if (!result && PyErr_Occurred() == PyExc_KeyboardInterrupt) {
+ _Py_UnhandledKeyboardInterrupt = 1;
+ }
+
Py_DECREF(runpy);
Py_DECREF(runmodule);
Py_DECREF(module);
Can you submit it as a PR? I don't have the time (but I can review once you've got tests working etc.) |
|
| Date |
User |
Action |
Args |
| 2020-09-16 20:40:27 | gvanrossum | set | recipients:
+ gvanrossum, gregory.p.smith, ncoghlan, eryksun, graingert |
| 2020-09-16 20:40:27 | gvanrossum | set | messageid: <[email protected]> |
| 2020-09-16 20:40:27 | gvanrossum | link | issue41602 messages |
| 2020-09-16 20:40:27 | gvanrossum | create | |
|