Do not quit hy if compile error occurs
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
12106d3d37
commit
bcdf31e287
8
bin/hy
8
bin/hy
@ -51,8 +51,12 @@ class HyREPL(code.InteractiveConsole):
|
|||||||
tokens = process(_machine.nodes)
|
tokens = process(_machine.nodes)
|
||||||
|
|
||||||
_machine = Machine(Idle, 1, 0)
|
_machine = Machine(Idle, 1, 0)
|
||||||
_ast = hy_compile(tokens, root=ast.Interactive)
|
try:
|
||||||
code = compile(_ast, filename, symbol)
|
_ast = hy_compile(tokens, root=ast.Interactive)
|
||||||
|
code = compile(_ast, filename, symbol)
|
||||||
|
except Exception:
|
||||||
|
self.showtraceback()
|
||||||
|
return False
|
||||||
|
|
||||||
self.runcode(code)
|
self.runcode(code)
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user