Skip to content

Commit

Permalink
sys.stdin can be None
Browse files Browse the repository at this point in the history
in which case we can't check if it's a tty or read from it
  • Loading branch information
minrk authored and mpacer committed Apr 28, 2017
1 parent 50597af commit 6540a83
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 @@ -1206,7 +1206,7 @@ def init_terminals(self):
log("Terminals not available (error was %s)", e)

def init_signal(self):
if not sys.platform.startswith('win') and sys.stdin.isatty():
if not sys.platform.startswith('win') and sys.stdin 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 6540a83

Please sign in to comment.