Skip to content

Commit 5a4b968

Browse files
committed
sys.stdin can be None
in which case we can't check if it's a tty or read from it
1 parent 7dac0a2 commit 5a4b968

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebook/notebookapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def init_terminals(self):
12061206
log("Terminals not available (error was %s)", e)
12071207

12081208
def init_signal(self):
1209-
if not sys.platform.startswith('win') and sys.stdin.isatty():
1209+
if not sys.platform.startswith('win') and sys.stdin and sys.stdin.isatty():
12101210
signal.signal(signal.SIGINT, self._handle_sigint)
12111211
signal.signal(signal.SIGTERM, self._signal_stop)
12121212
if hasattr(signal, 'SIGUSR1'):

0 commit comments

Comments
 (0)