diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-02 20:45:25 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-11-03 00:26:28 -0400 |
commit | c95001b130227dde480647fec9a9f745b83db1e2 (patch) | |
tree | d858819ec605a645bdce7146f3240c5caed92640 | |
parent | 535bd377b4f37d70f0043d7202514559dc44f486 (diff) | |
download | meson-c95001b130227dde480647fec9a9f745b83db1e2.zip meson-c95001b130227dde480647fec9a9f745b83db1e2.tar.gz meson-c95001b130227dde480647fec9a9f745b83db1e2.tar.bz2 |
dependencies: make the hdf5 dependency use Popen_safe
It is, after all, "safe". ;) That's why it exists. There's no reason to
think listing all pkg-config entries cannot print unicode descriptions,
it's absolutely possible, and we should handle it properly if we
encounter it.
-rw-r--r-- | mesonbuild/dependencies/hdf5.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py index c5c69e0..47ef5fe 100644 --- a/mesonbuild/dependencies/hdf5.py +++ b/mesonbuild/dependencies/hdf5.py @@ -21,7 +21,7 @@ import shutil import subprocess from pathlib import Path -from ..mesonlib import OrderedSet, join_args +from ..mesonlib import Popen_safe, OrderedSet, join_args from .base import DependencyException, DependencyMethods from .configtool import ConfigToolDependency from .pkgconfig import PkgConfigDependency @@ -163,10 +163,9 @@ def hdf5_factory(env: 'Environment', for_machine: 'MachineChoice', PCEXE = shutil.which('pkg-config') if PCEXE: # some distros put hdf5-1.2.3.pc with version number in .pc filename. - ret = subprocess.run([PCEXE, '--list-all'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, - text=True) + ret, stdout, _ = Popen_safe([PCEXE, '--list-all'], stderr=subprocess.DEVNULL) if ret.returncode == 0: - for pkg in ret.stdout.split('\n'): + for pkg in stdout.split('\n'): if pkg.startswith('hdf5'): pkgconfig_files.add(pkg.split(' ', 1)[0]) |