summaryrefslogtreecommitdiff
path: root/gitdb/db
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/db
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/db')
-rw-r--r--gitdb/db/loose.py3
1 files changed, 2 insertions, 1 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):