support '0' as an IntSetting value

This commit is contained in:
jesopo 2019-09-15 22:22:30 +01:00
parent 621fb0b396
commit f9d13dc373

View file

@ -298,6 +298,9 @@ class BoolSetting(Setting):
class IntSetting(Setting):
example = "10"
def parse(self, value: str) -> typing.Any:
if value == "0":
return 0
else:
stripped = value.lstrip("0")
if stripped.isdigit():
return int(stripped)