Skip to content

Commit b89cda4

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 <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>
1 parent 8d4fca3 commit b89cda4

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)