Die immediately on SIGINT if not in a tty

Closes gh-146
This commit is contained in:
Thomas Kluyver 2015-06-10 14:39:38 -07:00
parent da22554e9a
commit 25f5afd39f

View File

@ -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'):