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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Steven R Loomis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
dkasyanov authored and MylesBorins committed Jan 9, 2018
1 parent 8d4fca3 commit b89cda4
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 b89cda4

Please sign in to comment.