From 442c7d04db61323af24f4ad90a6d5a1b3d8aa3fa Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Sat, 20 Apr 2024 21:37:28 -0400 Subject: [PATCH] Core: Silently fix invalid yaml option for Toggles (#3179) --- Options.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Options.py b/Options.py index 65affb8d..fc633589 100644 --- a/Options.py +++ b/Options.py @@ -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