aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-02-28 12:16:58 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-03-01 15:17:59 -0500
commitf03c712d17213535f96f2ddece1253ea9abbdf6a (patch)
treed28795789fde024feec0d3b08f44eb540f8f774e /mesonbuild/interpreter
parentb4a512b9f8cecf11e54ffefbb0ee014a34cc00d2 (diff)
downloadmeson-f03c712d17213535f96f2ddece1253ea9abbdf6a.zip
meson-f03c712d17213535f96f2ddece1253ea9abbdf6a.tar.gz
meson-f03c712d17213535f96f2ddece1253ea9abbdf6a.tar.bz2
interpreter: fix notfound_program method
Which should take a File or str, but only handles str correctly. Which mypy would have caught for us, if we just had annotations here.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 2d891d9..88b6bfb 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1439,8 +1439,10 @@ external dependencies (including libraries) must go to "dependencies".''')
raise InterpreterException(f'Tried to override executable "{name}" which has already been overridden.')
self.build.find_overrides[name] = exe
- def notfound_program(self, args):
- return NonExistingExternalProgram(' '.join(args))
+ def notfound_program(self, args: T.List[mesonlib.FileOrString]) -> ExternalProgram:
+ return NonExistingExternalProgram(' '.join(
+ [a if isinstance(a, str) else a.absolute_path(self.environment.source_dir, self.environment.build_dir)
+ for a in args]))
# TODO update modules to always pass `for_machine`. It is bad-form to assume
# the host machine.