summaryrefslogtreecommitdiff
path: root/gitdb/stream.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-07 19:57:19 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-07 19:57:19 +0100
commitbe294278a0087f21d565a1084fb220ff936ae0bd (patch)
tree88d26f5f50794e42e9d77530cf823b2d5805209d /gitdb/stream.py
parent560a211001064261eb25ca874980591790fb7986 (diff)
downloadgitdb-be294278a0087f21d565a1084fb220ff936ae0bd.tar.gz
Protected stream closure against possibilty of being a bytes
For some reason, it gets bytes where it did expect a stream ... . Probably I should have figured out where this was input, instead of fixing it the brutal way
Diffstat (limited to 'gitdb/stream.py')
-rw-r--r--gitdb/stream.py3
1 files changed, 2 insertions, 1 deletions
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