Use HyTypeError to raise else' errors in foreach'

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2013-04-15 11:47:11 -07:00
parent d50551ca71
commit 475c2b6b63

View File

@ -974,8 +974,8 @@ class HyASTCompiler(object):
if expression and expression[-1][0] == HySymbol("else"):
else_expr = expression.pop()
if len(else_expr) > 2:
# XXX use HyTypeError as soon as it lands
raise TypeError("`else' statement in `foreach' is too long")
raise HyTypeError(else_expr,
"`else' statement in `foreach' is too long")
elif len(else_expr) == 2:
orelse = self._code_branch(
self.compile(else_expr[1]),