Commit 98aa6c9e by willmcgugan

Made opendir throw a ResourceInvalidError if the path is not a dir

parent d72f76c6
......@@ -893,6 +893,8 @@ class FS(object):
from fs.wrapfs.subfs import SubFS
if not self.exists(path):
raise ResourceNotFoundError(path)
if not self.isdir(path):
raise ResourceInvalidError("path should reference a directory")
return SubFS(self, path)
def walk(self,
......
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