Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions slothy/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ def parse_as_float(val):
def check_ty(ty_real):
if ty is None or ty is type(None) or ty == ty_real:
return
# Allow lists to be converted to sets
if ty == set and ty_real == list:
return
raise CmdLineException(
f"Configuration value {val} isn't correctly typed -- "
f"expected {ty}, but got {ty_real}"
Expand All @@ -242,11 +245,6 @@ def check_ty(ty_real):
check_ty(bool)
logger.debug("Value %s parsed as Boolean", val)
return False
# Try to parse as RegisterType
ty = arch.RegisterType.from_string(val)
if ty is not None:
logger.debug("Value %s parsed as RegisterType", val)
return ty
f = parse_as_float(val)
if f is not None:
check_ty(float)
Expand Down