From 9ecd578167790d3d5d857663db520d3cd423e28b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 1 Jul 2021 10:03:42 -0700 Subject: [PATCH] interpreter: use typed_pos_args for set_variable --- mesonbuild/interpreter/interpreter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 0ffa0627f..33115acda 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -2724,12 +2724,11 @@ This will become a hard error in the future.''', location=self.current_node) def is_subproject(self): return self.subproject != '' + @typed_pos_args('set_variable', str, object) @noKwargs @noArgsFlattening @noSecondLevelHolderResolving - def func_set_variable(self, node, args, kwargs): - if len(args) != 2: - raise InvalidCode('Set_variable takes two arguments.') + def func_set_variable(self, node: mparser.BaseNode, args: T.Tuple[str, object], kwargs: 'TYPE_kwargs') -> None: varname, value = args self.set_variable(varname, value, holderify=True)