@@ -2410,7 +2410,14 @@ def init_signal(self) -> None:
2410
2410
signal .signal (signal .SIGINFO , self ._signal_info )
2411
2411
2412
2412
def _handle_sigint (self , sig : t .Any , frame : t .Any ) -> None :
2413
- """SIGINT handler spawns confirmation dialog"""
2413
+ """SIGINT handler spawns confirmation dialog
2414
+
2415
+ Note:
2416
+ JupyterHub replaces this method with _signal_stop
2417
+ in order to bypass the interactive prompt.
2418
+ https://github.com/jupyterhub/jupyterhub/pull/4864
2419
+
2420
+ """
2414
2421
# register more forceful signal handler for ^C^C case
2415
2422
signal .signal (signal .SIGINT , self ._signal_stop )
2416
2423
# request confirmation dialog in bg thread, to avoid
@@ -2468,7 +2475,13 @@ def _confirm_exit(self) -> None:
2468
2475
self .io_loop .add_callback_from_signal (self ._restore_sigint_handler )
2469
2476
2470
2477
def _signal_stop (self , sig : t .Any , frame : t .Any ) -> None :
2471
- """Handle a stop signal."""
2478
+ """Handle a stop signal.
2479
+
2480
+ Note:
2481
+ JupyterHub configures this method to be called for SIGINT.
2482
+ https://github.com/jupyterhub/jupyterhub/pull/4864
2483
+
2484
+ """
2472
2485
self .log .critical (_i18n ("received signal %s, stopping" ), sig )
2473
2486
self .stop (from_signal = True )
2474
2487
0 commit comments