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 gibfahn committed Jan 24, 2018
1 parent 5485ad1 commit 990d22e
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 990d22e

Please sign in to comment.