aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-08-02 17:20:59 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-08-03 15:42:13 -0400
commit6d7562a02cc6b6e45f2a43c7a29223e75e88c3df (patch)
tree216935d03d12627a314a577ab08bc8e0836e5fde
parent28e6d2be9621dcd1056d6e386576510fd9cd8860 (diff)
downloadmeson-6d7562a02cc6b6e45f2a43c7a29223e75e88c3df.zip
meson-6d7562a02cc6b6e45f2a43c7a29223e75e88c3df.tar.gz
meson-6d7562a02cc6b6e45f2a43c7a29223e75e88c3df.tar.bz2
run_command: Remove useless node argument
There is no need to pass it, we already have self.current_node.
-rw-r--r--mesonbuild/interpreter/interpreter.py7
-rw-r--r--mesonbuild/programs.py2
2 files changed, 4 insertions, 5 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 4df8a12..4ef78e8 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -770,10 +770,9 @@ class Interpreter(InterpreterBase, HoldableObject):
args: T.Tuple[T.Union[build.Executable, ExternalProgram, compilers.Compiler, mesonlib.File, str],
T.List[T.Union[build.Executable, ExternalProgram, compilers.Compiler, mesonlib.File, str]]],
kwargs: 'kwtypes.RunCommand') -> RunProcess:
- return self.run_command_impl(node, args, kwargs)
+ return self.run_command_impl(args, kwargs)
def run_command_impl(self,
- node: mparser.BaseNode,
args: T.Tuple[T.Union[build.Executable, ExternalProgram, compilers.Compiler, mesonlib.File, str],
T.List[T.Union[build.Executable, ExternalProgram, compilers.Compiler, mesonlib.File, str]]],
kwargs: 'kwtypes.RunCommand',
@@ -829,7 +828,7 @@ class Interpreter(InterpreterBase, HoldableObject):
elif isinstance(a, ExternalProgram):
expanded_args.append(a.get_path())
elif isinstance(a, compilers.Compiler):
- FeatureNew.single_use('Compiler object as a variadic argument to `run_command`', '0.61.0', self.subproject, location=node)
+ FeatureNew.single_use('Compiler object as a variadic argument to `run_command`', '0.61.0', self.subproject, location=self.current_node)
prog = ExternalProgram(a.exelist[0], silent=True)
if not prog.found():
raise InterpreterException(f'Program {cmd!r} not found or not executable')
@@ -2687,7 +2686,7 @@ class Interpreter(InterpreterBase, HoldableObject):
_cmd = mesonlib.substitute_values(kwargs['command'], values)
mlog.log('Configuring', mlog.bold(output), 'with command')
cmd, *args = _cmd
- res = self.run_command_impl(node, (cmd, args),
+ res = self.run_command_impl((cmd, args),
{'capture': True, 'check': True, 'env': EnvironmentVariables()},
True)
if kwargs['capture']:
diff --git a/mesonbuild/programs.py b/mesonbuild/programs.py
index 13b9981..beb5bc5 100644
--- a/mesonbuild/programs.py
+++ b/mesonbuild/programs.py
@@ -105,7 +105,7 @@ class ExternalProgram(mesonlib.HoldableObject):
if not self.cached_version:
raw_cmd = self.get_command() + ['--version']
if interpreter:
- res = interpreter.run_command_impl(interpreter.current_node, (self, ['--version']),
+ res = interpreter.run_command_impl((self, ['--version']),
{'capture': True,
'check': True,
'env': mesonlib.EnvironmentVariables()},