From fb00f1cb894e50c80c0668083a27d0eb031e18c0 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 11 May 2015 17:19:07 -0700 Subject: [PATCH] don't list profiles in nonexistent directories --- jupyter_notebook/services/clusters/clustermanager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jupyter_notebook/services/clusters/clustermanager.py b/jupyter_notebook/services/clusters/clustermanager.py index f2e98a5f4..5d5a3799b 100644 --- a/jupyter_notebook/services/clusters/clustermanager.py +++ b/jupyter_notebook/services/clusters/clustermanager.py @@ -3,6 +3,8 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. +import os + from tornado import web from traitlets.config.configurable import LoggingConfigurable @@ -60,6 +62,8 @@ class ClusterManager(LoggingConfigurable): return stale = set(self.profiles) for path in [get_ipython_dir(), py3compat.getcwd()]: + if not os.path.isdir(path): + continue for profile in list_profiles_in(path): if profile in stale: stale.remove(profile)