Do not quit hy if compile error occurs

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2013-04-03 11:34:10 +02:00
parent 12106d3d37
commit bcdf31e287
1 changed files with 6 additions and 2 deletions

8
bin/hy
View File

@ -51,8 +51,12 @@ class HyREPL(code.InteractiveConsole):
tokens = process(_machine.nodes)
_machine = Machine(Idle, 1, 0)
_ast = hy_compile(tokens, root=ast.Interactive)
code = compile(_ast, filename, symbol)
try:
_ast = hy_compile(tokens, root=ast.Interactive)
code = compile(_ast, filename, symbol)
except Exception:
self.showtraceback()
return False
self.runcode(code)
return False