Commit 0a533ceb by rfkelly0

trap lookups of known attributes in __getattr__

parent b8add3a0
...@@ -225,13 +225,17 @@ class WrapFS(FS): ...@@ -225,13 +225,17 @@ class WrapFS(FS):
raise UnsupportedError("listxattrs") raise UnsupportedError("listxattrs")
def __getattr__(self,attr): def __getattr__(self,attr):
if attr == "closed":
return False
if attr == "wrapped_fs":
return None
return getattr(self.wrapped_fs,attr) return getattr(self.wrapped_fs,attr)
@rewrite_errors @rewrite_errors
def close(self): def close(self):
if not self.closed: if not self.closed:
self.wrapped_fs.close() self.wrapped_fs.close()
super(WrapFS,self).close() super(WrapFS,self).close()
def wrap_fs_methods(decorator,cls=None,exclude=[]): def wrap_fs_methods(decorator,cls=None,exclude=[]):
......
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