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.
pull/8010/head
Dylan Baker 4 years ago
parent 93ecfa646b
commit 49f8ff8410
  1. 2
      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', [])

Loading…
Cancel
Save