Skip to content

Commit 86092a1

Browse files
committed
use add_callback_from_signal
1 parent 90004b9 commit 86092a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notebook/notebookapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ def _confirm_exit(self):
12791279
self.log.critical(_("Shutdown confirmed"))
12801280
# schedule stop on the main thread,
12811281
# since this might be called from a signal handler
1282-
self.io_loop.add_callback(self.io_loop.stop)
1282+
self.io_loop.add_callback_from_signal(self.io_loop.stop)
12831283
return
12841284
else:
12851285
print(_("No answer for 5s:"), end=' ')
@@ -1288,7 +1288,7 @@ def _confirm_exit(self):
12881288
# set it back to original SIGINT handler
12891289
# use IOLoop.add_callback because signal.signal must be called
12901290
# from main thread
1291-
self.io_loop.add_callback(self._restore_sigint_handler)
1291+
self.io_loop.add_callback_from_signal(self._restore_sigint_handler)
12921292

12931293
def _signal_stop(self, sig, frame):
12941294
self.log.critical(_("received signal %s, stopping"), sig)

0 commit comments

Comments
 (0)