Raise more appropriate error on missing kwarg value

This commit is contained in:
Ewald Grusk 2015-06-15 22:42:02 +02:00 committed by Gergely Nagy
parent 0c73f78ed0
commit 4138c660cc

View File

@ -459,8 +459,9 @@ class HyASTCompiler(object):
try:
value = next(exprs_iter)
except StopIteration:
msg = "Keyword argument {kw} needs a value"
raise HyCompileError(msg.format(kw=str(expr)))
raise HyTypeError(expr,
"Keyword argument {kw} needs "
"a value.".format(kw=str(expr)))
compiled_value = self.compile(value)
ret += compiled_value