Skip to content

Commit 4486dcd

Browse files
committed
reset _Py_UnhandledKeyboardInterrupt before calling runpy._run_module_as_main
1 parent 0b325b6 commit 4486dcd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ pymain_run_module(const wchar_t *modname, int set_argv0)
287287
Py_DECREF(module);
288288
return pymain_exit_err_print();
289289
}
290+
_Py_UnhandledKeyboardInterrupt = 0;
290291
result = PyObject_Call(runmodule, runargs, NULL);
291292
if (!result && PyErr_Occurred() == PyExc_KeyboardInterrupt) {
292293
_Py_UnhandledKeyboardInterrupt = 1;

0 commit comments

Comments
 (0)