From 9f07a1ad412188c587e108244ceb90e5e5f446f0 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 1 Jul 2021 10:24:41 -0700 Subject: [PATCH] interpreter: use typed_pos_args for get_option --- mesonbuild/interpreter/interpreter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 6548002dd..746b06e52 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1037,11 +1037,10 @@ external dependencies (including libraries) must go to "dependencies".''') raise InterpreterException('Tried to access unknown option "%s".' % optname) - @stringArgs + @typed_pos_args('get_option', str) @noKwargs - def func_get_option(self, nodes, args, kwargs): - if len(args) != 1: - raise InterpreterException('Argument required for get_option.') + def func_get_option(self, nodes: mparser.BaseNode, args: T.Tuple[str], + kwargs: 'TYPE_kwargs') -> T.Union[coredata.UserOption, 'TYPE_var']: optname = args[0] if ':' in optname: raise InterpreterException('Having a colon in option name is forbidden, '