diff options
author | SpaceRacet5w2A6l0I <59487396+SpaceRacet5w2A6l0I@users.noreply.github.com> | 2020-01-05 21:07:19 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-01-08 10:58:20 +0300 |
commit | bd6d6512f02d6fa10a0484577c270bb44f1b750b (patch) | |
tree | 4cc6c3f14cd74dd748475e000869bfdfa40fc40b /configure.py | |
parent | 96eceb75198e53b16e786248a8ca1e7d0d92e209 (diff) |
build: avoid using CMP for BZ2File
Some Python distributions do not support
context manager protocol (CMP) for BZ2File.
PR-URL: https://github.com/nodejs/node/pull/31198
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.py b/configure.py index bc6bff224b6..682feb44e45 100755 --- a/configure.py +++ b/configure.py @@ -1540,8 +1540,11 @@ def configure_intl(o): os.mkdir(icu_tmp_path) icu_data_path = os.path.join(icu_tmp_path, icu_data_file_l) with open(icu_data_path, 'wb') as outf: - with bz2.BZ2File(compressed_data, 'rb') as inf: - shutil.copyfileobj(inf, outf) + inf = bz2.BZ2File(compressed_data, 'rb') + try: + shutil.copyfileobj(inf, outf) + finally: + inf.close() # Now, proceed.. # relative to dep.. |