diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-11-20 11:34:57 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-11-20 14:48:35 -0800 |
commit | 49f8ff841097af0d2cff215304b90d366cb6c7cc (patch) | |
tree | fc232fbbd767da5443f609de78bfbfa839151b99 | |
parent | 93ecfa646b171af63255847db6ddaafbbb44e9cc (diff) | |
download | meson-49f8ff841097af0d2cff215304b90d366cb6c7cc.zip meson-49f8ff841097af0d2cff215304b90d366cb6c7cc.tar.gz meson-49f8ff841097af0d2cff215304b90d366cb6c7cc.tar.bz2 |
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.
-rw-r--r-- | mesonbuild/optinterpreter.py | 2 |
1 files changed, 1 insertions, 1 deletions
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', []) |