mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Merge pull request #91 from takluyver/runtime-dir-absent
Fix list_running_servers when runtime dir not created
This commit is contained in:
commit
666fdf7157
@ -1126,6 +1126,11 @@ def list_running_servers(runtime_dir=None):
|
|||||||
"""
|
"""
|
||||||
if runtime_dir is None:
|
if runtime_dir is None:
|
||||||
runtime_dir = jupyter_runtime_dir()
|
runtime_dir = jupyter_runtime_dir()
|
||||||
|
|
||||||
|
# The runtime dir might not exist
|
||||||
|
if not os.path.isdir(runtime_dir):
|
||||||
|
return
|
||||||
|
|
||||||
for file in os.listdir(runtime_dir):
|
for file in os.listdir(runtime_dir):
|
||||||
if file.startswith('nbserver-'):
|
if file.startswith('nbserver-'):
|
||||||
with io.open(os.path.join(runtime_dir, file), encoding='utf-8') as f:
|
with io.open(os.path.join(runtime_dir, file), encoding='utf-8') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user