This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients eryksun, graingert, gregory.p.smith, gvanrossum, ncoghlan
Date 2020-09-16.20:40:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600288827.74.0.439638876433.issue41602@roundup.psfhosted.org>
In-reply-to
Content
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.)
History
Date User Action Args
2020-09-16 20:40:27gvanrossumsetrecipients: + gvanrossum, gregory.p.smith, ncoghlan, eryksun, graingert
2020-09-16 20:40:27gvanrossumsetmessageid: <1600288827.74.0.439638876433.issue41602@roundup.psfhosted.org>
2020-09-16 20:40:27gvanrossumlinkissue41602 messages
2020-09-16 20:40:27gvanrossumcreate