diff options
| -rw-r--r-- | gitdb/db/loose.py | 3 | ||||
| -rw-r--r-- | gitdb/stream.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py index e924080..4732b56 100644 --- a/gitdb/db/loose.py +++ b/gitdb/db/loose.py @@ -159,7 +159,8 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW): typ, size = loose_object_header_info(m) return OInfo(sha, typ, size) finally: - m.close() + if hasattr(m, 'close'): + m.close() # END assure release of system resources def stream(self, sha): diff --git a/gitdb/stream.py b/gitdb/stream.py index d855257..826def3 100644 --- a/gitdb/stream.py +++ b/gitdb/stream.py @@ -145,7 +145,8 @@ class DecompressMemMapReader(LazyMixin): :note: can be called safely """ if self._close: - self._m.close() + if hasattr(self._m, 'close'): + self._m.close() self._close = False # END handle resource freeing |
