catch: use the right symbol name in errors

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2013-04-09 16:58:32 +02:00
parent dd90272129
commit 48d5a0abc0

View File

@ -242,7 +242,7 @@ class HyASTCompiler(object):
if not isinstance(exceptions, HyList):
raise TypeError("`%s' exceptions list is not a list" % catch)
if len(exceptions) > 2:
raise TypeError("`catch' exceptions list is too long")
raise TypeError("`%s' exceptions list is too long" % catch)
# [variable [list of exceptions]]
# let's pop variable and use it as name
@ -280,7 +280,7 @@ class HyASTCompiler(object):
elif isinstance(exceptions_list, HySymbol):
_type = self.compile(exceptions_list)
else:
raise TypeError("`catch' needs a valid exception list to catch")
raise TypeError("`%s' needs a valid exception list" % catch)
body = self._code_branch([self.compile(x) for x in expr],
expr.start_line,