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)