argparser: Check for unknown types.
This commit is contained in:
parent
506917882e
commit
ed70d636d0
@ -119,6 +119,8 @@ def multitype_conv(types):
|
|||||||
return typ(value)
|
return typ(value)
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
|
raise ValueError("Unknown type {!r}!".format(typ))
|
||||||
raise cmdexc.ArgumentTypeError('Invalid value {}.'.format(value))
|
raise cmdexc.ArgumentTypeError('Invalid value {}.'.format(value))
|
||||||
|
|
||||||
return _convert
|
return _convert
|
||||||
|
Loading…
Reference in New Issue
Block a user