aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/programs.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-11-01 12:43:08 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-11-29 18:12:33 -0800
commitfcced46c9937c8971021dfe8a3349c0948a74e1b (patch)
tree1012c2d1c09e1617d77f142391a54d9f9694a98e /mesonbuild/programs.py
parent3a168513bd4ff041143ee9b4ba84d97dbcd13169 (diff)
downloadmeson-fcced46c9937c8971021dfe8a3349c0948a74e1b.zip
meson-fcced46c9937c8971021dfe8a3349c0948a74e1b.tar.gz
meson-fcced46c9937c8971021dfe8a3349c0948a74e1b.tar.bz2
interpreter: use typed_kwargs for run_command
This also cleans up a couple of internal callers of the internal impl version that don't set the `check` argument, and therefore trigger a warning about not setting the check argument.
Diffstat (limited to 'mesonbuild/programs.py')
-rw-r--r--mesonbuild/programs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/programs.py b/mesonbuild/programs.py
index eefdc74..192c273 100644
--- a/mesonbuild/programs.py
+++ b/mesonbuild/programs.py
@@ -102,10 +102,11 @@ class ExternalProgram(mesonlib.HoldableObject):
def get_version(self, interpreter: 'Interpreter') -> str:
if not self.cached_version:
+ from . import build
raw_cmd = self.get_command() + ['--version']
- res = interpreter.run_command_impl(interpreter.current_node, (self, ['--version']), {}, True)
- if res.returncode != 0:
- raise mesonlib.MesonException(f'Running {raw_cmd!r} failed')
+ res = interpreter.run_command_impl(interpreter.current_node, (self, ['--version']),
+ {'capture': True, 'check': True, 'env': build.EnvironmentVariables()},
+ True)
output = res.stdout.strip()
if not output:
output = res.stderr.strip()