mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Die immediately on SIGINT if not in a tty
Closes gh-146
This commit is contained in:
parent
da22554e9a
commit
25f5afd39f
@ -894,7 +894,7 @@ class NotebookApp(JupyterApp):
|
||||
log("Terminals not available (error was %s)", e)
|
||||
|
||||
def init_signal(self):
|
||||
if not sys.platform.startswith('win'):
|
||||
if not sys.platform.startswith('win') and sys.stdin.isatty():
|
||||
signal.signal(signal.SIGINT, self._handle_sigint)
|
||||
signal.signal(signal.SIGTERM, self._signal_stop)
|
||||
if hasattr(signal, 'SIGUSR1'):
|
||||
|
Loading…
Reference in New Issue
Block a user