Skip to content

Commit

Permalink
Merge pull request #147 from takluyver/sigint-no-tty-die
Browse files Browse the repository at this point in the history
Die immediately on SIGINT if not in a tty
  • Loading branch information
minrk committed Jun 10, 2015
2 parents da22554 + 25f5afd commit 5da299e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def init_terminals(self):
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'):
Expand Down

0 comments on commit 5da299e

Please sign in to comment.