Skip to content

Commit

Permalink
close filesystem on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jul 28, 2019
1 parent 0631416 commit e945b5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/base.py
Expand Up @@ -112,6 +112,10 @@ def __init__(self):
self._lock = threading.RLock()
super(FS, self).__init__()

def __del__(self):
"""Auto-close the filesystem on exit."""
self.close()

def __enter__(self):
# type: (...) -> FS
"""Allow use of filesystem as a context manager.
Expand Down

0 comments on commit e945b5e

Please sign in to comment.