From bb0f9422a2467f2e091da9953e7a5bce8002e562 2014-04-29 17:26:08 From: MinRK Date: 2014-04-29 17:26:08 Subject: [PATCH] better error message when path exists but is not dir --- diff --git a/IPython/utils/path.py b/IPython/utils/path.py index f533fe2..fcb4a0b 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -577,4 +577,5 @@ def ensure_dir_exists(path, mode=0o777): except OSError as e: if e.errno != errno.EEXIST: raise - \ No newline at end of file + elif not os.path.isdir(path): + raise IOError("%r exists but is not a directory" % path)