sys.stdin can be None

in which case we can't check if it's a tty or read from it
Min RK 9 years ago
parent 7dac0a2bac
commit 5a4b968e3b

@ -1206,7 +1206,7 @@ class NotebookApp(JupyterApp):
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'):

Loading…
Cancel
Save