diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 839102cddb..3985316f09 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -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'):