Skip to content

Commit 32f528a

Browse files
dkasyanovMylesBorins
authored andcommitted
tools: fix AttributeError: __exit__ on Python 2.6
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]>
1 parent 0ce48f9 commit 32f528a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/configure.d/nodedownload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def unpack(packedfile, parent_path):
6060
icuzip.extractall(parent_path)
6161
return parent_path
6262
elif tarfile.is_tarfile(packedfile):
63-
with tarfile.TarFile.open(packedfile, 'r') as icuzip:
63+
with contextlib.closing(tarfile.TarFile.open(packedfile, 'r')) as icuzip:
6464
print ' Extracting tarfile: %s' % packedfile
6565
icuzip.extractall(parent_path)
6666
return parent_path

0 commit comments

Comments
 (0)