Core: Silently fix invalid yaml option for Toggles (#3179)

This commit is contained in:
Scipio Wright 2024-04-20 21:37:28 -04:00 committed by GitHub
parent ad4451276d
commit 442c7d04db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -384,7 +384,8 @@ class Toggle(NumericOption):
default = 0
def __init__(self, value: int):
assert value == 0 or value == 1, "value of Toggle can only be 0 or 1"
# if user puts in an invalid value, make it valid
value = int(bool(value))
self.value = value
@classmethod