argparser: Check for unknown types.

This commit is contained in:
Florian Bruhin 2015-08-20 07:09:09 +02:00
parent 506917882e
commit ed70d636d0

View File

@ -119,6 +119,8 @@ def multitype_conv(types):
return typ(value)
except (TypeError, ValueError):
pass
else:
raise ValueError("Unknown type {!r}!".format(typ))
raise cmdexc.ArgumentTypeError('Invalid value {}.'.format(value))
return _convert