blob: 30c2295dd1868e899be492eb3ad0c2935210edef [file] [log] [blame]
Chris McDonald5ca5bf22019-08-07 14:53:57 -06001Upstream bugs:
2https://bugs.gentoo.org/678410
3https://bugs.python.org/issue23395
4
5This patch fixes some spurious exceptions caused by interrupts
6that don't have a handler registered in some situations.
7
8diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
9index 0b9e8f1..f161e18 100644
10--- a/Modules/signalmodule.c
11+++ b/Modules/signalmodule.c
12@@ -1575,7 +1575,10 @@ PyErr_CheckSignals(void)
13 void
14 PyErr_SetInterrupt(void)
15 {
16- trip_signal(SIGINT);
17+ if ((Handlers[SIGINT].func != IgnoreHandler) &&
18+ (Handlers[SIGINT].func != DefaultHandler)) {
19+ trip_signal(SIGINT);
20+ }
21 }
22
23 void