mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
warn about failure to bind to localhost
when falling back on 127.0.0.1
This commit is contained in:
parent
c605ea44cc
commit
f76ce1d6b9
@ -418,7 +418,8 @@ class NotebookApp(BaseIPythonApplication):
|
||||
s = socket.socket()
|
||||
try:
|
||||
s.bind(('localhost', 0))
|
||||
except socket.error:
|
||||
except socket.error as e:
|
||||
self.log.warn("Cannot bind to localhost, using 127.0.0.1 as default ip\n%s", e)
|
||||
return '127.0.0.1'
|
||||
else:
|
||||
s.close()
|
||||
|
Loading…
Reference in New Issue
Block a user