support '0' as an IntSetting value
This commit is contained in:
parent
621fb0b396
commit
f9d13dc373
1 changed files with 6 additions and 3 deletions
|
@ -298,6 +298,9 @@ class BoolSetting(Setting):
|
||||||
class IntSetting(Setting):
|
class IntSetting(Setting):
|
||||||
example = "10"
|
example = "10"
|
||||||
def parse(self, value: str) -> typing.Any:
|
def parse(self, value: str) -> typing.Any:
|
||||||
|
if value == "0":
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
stripped = value.lstrip("0")
|
stripped = value.lstrip("0")
|
||||||
if stripped.isdigit():
|
if stripped.isdigit():
|
||||||
return int(stripped)
|
return int(stripped)
|
||||||
|
|
Loading…
Reference in a new issue