From a91ac2011f0131ce550bf227d78ccccbdab4f882 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 5 Oct 2014 19:01:34 +0100 Subject: py: Make compiler return a proper exception on SyntaxError. --- stmhal/pyexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stmhal') diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c index 01c0173ef..0ce4882e2 100644 --- a/stmhal/pyexec.c +++ b/stmhal/pyexec.c @@ -72,7 +72,8 @@ bool parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t input_kind, bo mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, is_repl); - if (module_fun == mp_const_none) { + if (mp_obj_is_exception_instance(module_fun)) { + mp_obj_print_exception(module_fun); return false; } -- cgit v1.2.3