Commit f9490efc by willmcgugan@gmail.com

Fix for mountfs with no mounts #162

parent cb0a8291
...@@ -246,6 +246,8 @@ class MountFS(FS): ...@@ -246,6 +246,8 @@ class MountFS(FS):
fs, _mount_path, delegate_path = self._delegate(path) fs, _mount_path, delegate_path = self._delegate(path)
if fs is None: if fs is None:
if path in ("/", ""):
return
raise ResourceNotFoundError(path) raise ResourceNotFoundError(path)
if fs is self: if fs is self:
...@@ -465,6 +467,8 @@ class MountFS(FS): ...@@ -465,6 +467,8 @@ class MountFS(FS):
fs, _mount_path, delegate_path = self._delegate(path) fs, _mount_path, delegate_path = self._delegate(path)
if fs is None: if fs is None:
if path in ("/", ""):
return {}
raise ResourceNotFoundError(path) raise ResourceNotFoundError(path)
if fs is self: if fs is self:
...@@ -499,6 +503,8 @@ class MountFS(FS): ...@@ -499,6 +503,8 @@ class MountFS(FS):
path = normpath(path) path = normpath(path)
fs, _mount_path, delegate_path = self._delegate(path) fs, _mount_path, delegate_path = self._delegate(path)
if fs is None: if fs is None:
if path in ("/", ""):
return default
raise ResourceNotFoundError(path) raise ResourceNotFoundError(path)
if fs is self: if fs is self:
return default return default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment