From 998a1f5fa3f7e86ce3902544bc61f54c9709926b Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 19 Oct 2019 09:52:06 +0200 Subject: [PATCH] mdist.py: import lzma only when needed Source of patch: http://lists.busybox.net/pipermail/buildroot/2019-October/262990.html http://code.bulix.org/gdxcu4-914360 Fixes https://github.com/mesonbuild/meson/issues/6012 --- mesonbuild/mdist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index 7b7538263..28e2fcedd 100644 --- a/mesonbuild/mdist.py +++ b/mesonbuild/mdist.py @@ -13,7 +13,6 @@ # limitations under the License. -import lzma import gzip import os import sys @@ -133,6 +132,7 @@ def create_dist_hg(dist_name, archives, src_root, bld_root, dist_sub, dist_scrip if dist_scripts: mlog.warning('dist scripts are not supported in Mercurial projects') if 'xztar' in archives: + import lzma with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf: shutil.copyfileobj(tf, xf) output_names.append(xzname)