File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 1+ Fixed reset of the SIGINT handler to SIG_DFL on interpreter shutdown even
2+ when there was a custom handler set previously. Patch by Philipp Kerling.
Original file line number Diff line number Diff line change @@ -95,13 +95,6 @@ static PyObject *DefaultHandler;
9595static PyObject * IgnoreHandler ;
9696static PyObject * IntHandler ;
9797
98- /* On Solaris 8, gcc will produce a warning that the function
99- declaration is not a prototype. This is caused by the definition of
100- SIG_DFL as (void (*)())0; the correct declaration would have been
101- (void (*)(int))0. */
102-
103- static PyOS_sighandler_t old_siginthandler = SIG_DFL ;
104-
10598#ifdef HAVE_GETITIMER
10699static PyObject * ItimerError ;
107100
@@ -629,7 +622,7 @@ initsignal(void)
629622 /* Install default int handler */
630623 Py_INCREF (IntHandler );
631624 Py_SETREF (Handlers [SIGINT ].func , IntHandler );
632- old_siginthandler = PyOS_setsig (SIGINT , signal_handler );
625+ PyOS_setsig (SIGINT , signal_handler );
633626 }
634627
635628#ifdef SIGHUP
@@ -872,14 +865,11 @@ finisignal(void)
872865 int i ;
873866 PyObject * func ;
874867
875- PyOS_setsig (SIGINT , old_siginthandler );
876- old_siginthandler = SIG_DFL ;
877-
878868 for (i = 1 ; i < NSIG ; i ++ ) {
879869 func = Handlers [i ].func ;
880870 Handlers [i ].tripped = 0 ;
881871 Handlers [i ].func = NULL ;
882- if (i != SIGINT && func != NULL && func != Py_None &&
872+ if (func != NULL && func != Py_None &&
883873 func != DefaultHandler && func != IgnoreHandler )
884874 PyOS_setsig (i , SIG_DFL );
885875 Py_XDECREF (func );
You can’t perform that action at this time.
0 commit comments