From 94b546518369b66e2ea69d89248a0077a5332f6d Mon Sep 17 00:00:00 2001 From: "willmcgugan@gmail.com" Date: Mon, 9 Sep 2013 20:02:26 +0000 Subject: Fix for mountfs with no mounts #162 git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@866 67cdc799-7952-0410-af00-57a81ceafa0f --- fs/mountfs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/mountfs.py b/fs/mountfs.py index fce3a19..c7eabaf 100644 --- a/fs/mountfs.py +++ b/fs/mountfs.py @@ -246,6 +246,8 @@ class MountFS(FS): fs, _mount_path, delegate_path = self._delegate(path) if fs is None: + if path in ("/", ""): + return raise ResourceNotFoundError(path) if fs is self: @@ -465,6 +467,8 @@ class MountFS(FS): fs, _mount_path, delegate_path = self._delegate(path) if fs is None: + if path in ("/", ""): + return {} raise ResourceNotFoundError(path) if fs is self: @@ -499,6 +503,8 @@ class MountFS(FS): path = normpath(path) fs, _mount_path, delegate_path = self._delegate(path) if fs is None: + if path in ("/", ""): + return default raise ResourceNotFoundError(path) if fs is self: return default -- cgit v1.2.1