Skip to content
Snippets Groups Projects
Commit 5ac11aed authored by Jonas Haag's avatar Jonas Haag
Browse files

Merge pull request #125 from danajpl/python2.6

Tarutils Python 2.6 compatibility
parents 87993de1 858e64af
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import os
import stat
import tarfile
from io import BytesIO
from contextlib import closing
class ListBytesIO(object):
......@@ -50,7 +51,7 @@ def tar_stream(repo, tree, mtime, format=''):
time of all files in the resulting .tar.gz archive.
"""
buf = BytesIO()
with tarfile.open(None, "w:%s" % format, buf) as tar:
with closing(tarfile.open(None, "w:%s" % format, buf)) as tar:
for entry_abspath, entry in walk_tree(repo, tree):
try:
blob = repo[entry.sha]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment