From 65476829a389207af18dd7cf88899165a2fbf8b5 Mon Sep 17 00:00:00 2001 From: SpaceRacet5w2A6l0I <59487396+SpaceRacet5w2A6l0I@users.noreply.github.com> Date: Sun, 5 Jan 2020 19:07:19 +0100 Subject: [PATCH 1/2] build: avoid using CMP for BZ2File Some Python distributions do not support context manager protocol (CMP) for BZ2File. --- configure.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index bc6bff224b6515..7c4e0506569e1e 100755 --- a/configure.py +++ b/configure.py @@ -1540,8 +1540,11 @@ def write_config(data, name): 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: + inf = bz2.BZ2File(compressed_data, 'rb') + try: shutil.copyfileobj(inf, outf) + finally: + inf.close() # Now, proceed.. # relative to dep.. From 036b89794cad3a67c86e19ebeb694f7119164485 Mon Sep 17 00:00:00 2001 From: SpaceRacet5w2A6l0I <59487396+SpaceRacet5w2A6l0I@users.noreply.github.com> Date: Mon, 6 Jan 2020 12:11:18 +0100 Subject: [PATCH 2/2] Update configure.py --- configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index 7c4e0506569e1e..682feb44e459a3 100755 --- a/configure.py +++ b/configure.py @@ -1542,9 +1542,9 @@ def write_config(data, name): with open(icu_data_path, 'wb') as outf: inf = bz2.BZ2File(compressed_data, 'rb') try: - shutil.copyfileobj(inf, outf) + shutil.copyfileobj(inf, outf) finally: - inf.close() + inf.close() # Now, proceed.. # relative to dep..