diff options
author | Dmitriy Kasyanov <korvin1986@gmail.com> | 2017-12-13 23:21:24 +0200 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-02-12 19:28:27 -0500 |
commit | 32f528a92e399b24f5cc3fbb264b6d5fb2f3138a (patch) | |
tree | 481e4c3f2080eb3e716ff93e4ba49eaa4e36eaa0 | |
parent | 0ce48f90944bccdcdbb8beb1dc332e5e81d99380 (diff) | |
download | node-new-32f528a92e399b24f5cc3fbb264b6d5fb2f3138a.tar.gz |
tools: fix AttributeError: __exit__ on Python 2.6
Error occurs while dealing with Tar archives
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r-- | tools/configure.d/nodedownload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/configure.d/nodedownload.py b/tools/configure.d/nodedownload.py index 5cf8e0dbd6..3f4bc090f7 100644 --- a/tools/configure.d/nodedownload.py +++ b/tools/configure.d/nodedownload.py @@ -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 |