Skip to content

Commit

Permalink
mdist.py: import lzma only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetazzoni authored and jpakkane committed Oct 19, 2019
1 parent ba7428c commit 998a1f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/mdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.


import lzma
import gzip
import os
import sys
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 998a1f5

Please sign in to comment.