Report bad choice values when parsing config

This commit is contained in:
Kovid Goyal 2021-05-28 17:09:53 +05:30
parent 43ece23b89
commit 49c4b20113
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -102,7 +102,7 @@ class Choice:
def __call__(self, x: str) -> str:
x = x.lower()
if x not in self.all_choices:
x = self.defval
raise ValueError(f'The value {x} is not a known choice')
return x