diff options
author | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2019-10-19 09:52:06 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-10-19 14:28:34 +0300 |
commit | 998a1f5fa3f7e86ce3902544bc61f54c9709926b (patch) | |
tree | 8da06fa09767c0c987e3e0b9d83e69716b27a705 /mesonbuild/mdist.py | |
parent | ba7428c9d30a32a02c13166e586406138d4508a6 (diff) | |
download | meson-998a1f5fa3f7e86ce3902544bc61f54c9709926b.zip meson-998a1f5fa3f7e86ce3902544bc61f54c9709926b.tar.gz meson-998a1f5fa3f7e86ce3902544bc61f54c9709926b.tar.bz2 |
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
Diffstat (limited to 'mesonbuild/mdist.py')
-rw-r--r-- | mesonbuild/mdist.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py index 7b75382..28e2fce 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) |