diff options
| author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-07 07:03:15 +0530 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-12-11 01:59:58 +0200 |
| commit | 60716fcd6debd9f1ebca0091c945df16a3bd3715 (patch) | |
| tree | 75b1444898aabcd90b9e4731f4eb1d56a078c790 /mesonbuild/scripts/meson_install.py | |
| parent | be04aa2a0b00d123aae78da2448a216f7e3201b9 (diff) | |
| download | meson-60716fcd6debd9f1ebca0091c945df16a3bd3715.tar.gz | |
Use universal_newlines=True for all Popen calls
Instead of adding it everywhere manually, create a wrapper called
mesonlib.Popen_safe and use that everywhere that we call an executable
and extract its output.
This will also allow us to tweak it to do more/different things if
needed for some locales and/or systems.
Closes #1079
Diffstat (limited to 'mesonbuild/scripts/meson_install.py')
| -rwxr-xr-x | mesonbuild/scripts/meson_install.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index 14539e090..3d220223a 100755 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -18,6 +18,7 @@ import sys, pickle, os, shutil, subprocess, gzip, platform from glob import glob from . import depfixer from . import destdir_join +from ..mesonlib import MesonException, Popen_safe install_log_file = None @@ -205,12 +206,11 @@ def install_targets(d): do_copy(fname, outname) if should_strip: print('Stripping target') - ps = subprocess.Popen(['strip', outname], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (stdo, stde) = ps.communicate() + ps, stdo, stde = Popen_safe(['strip', outname]) if ps.returncode != 0: print('Could not strip file.\n') - print('Stdout:\n%s\n' % stdo.decode()) - print('Stderr:\n%s\n' % stde.decode()) + print('Stdout:\n%s\n' % stdo) + print('Stderr:\n%s\n' % stde) sys.exit(1) printed_symlink_error = False for alias in aliases: |
