Skip to content

Commit

Permalink
tools: fix AttributeError: __exit__ on Python 2.6
Browse files Browse the repository at this point in the history
Error occurs while dealing with Tar archives

PR-URL: #17663
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
dkasyanov authored and MylesBorins committed Feb 12, 2018
1 parent 6c2bfe8 commit 045956d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/configure.d/nodedownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def unpack(packedfile, parent_path):
icuzip.extractall(parent_path)
return parent_path
elif tarfile.is_tarfile(packedfile):
with tarfile.TarFile.open(packedfile, 'r') as icuzip:
with contextlib.closing(tarfile.TarFile.open(packedfile, 'r')) as icuzip:
print ' Extracting tarfile: %s' % packedfile
icuzip.extractall(parent_path)
return parent_path
Expand Down

0 comments on commit 045956d

Please sign in to comment.