From 49f8ff841097af0d2cff215304b90d366cb6c7cc Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 20 Nov 2020 11:34:57 -0800 Subject: optinterpreter: fix value being set in loop This value shouldn't be set in the loop, it's probably been making things slow, but also creates the potential that if choices is an empty list that value would be unbound. While that's exteremly unlikly to happen in practice, it is showing up as a warning from pylance. --- mesonbuild/optinterpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/optinterpreter.py') diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index d7751cb..d919b93 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -110,7 +110,7 @@ def string_array_parser(description: str, kwargs: T.Dict[str, T.Any]) -> coredat for i in choices: if not isinstance(i, str): raise OptionException('Array choice elements must be strings.') - value = kwargs.get('value', choices) + value = kwargs.get('value', choices) else: choices = None value = kwargs.get('value', []) -- cgit v1.1