summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-05 19:01:34 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-05 19:01:34 +0100
commita91ac2011f0131ce550bf227d78ccccbdab4f882 (patch)
tree4efcd77de48edbf4017307babe46e9e6b1337c17 /stmhal
parent6dba992182af9b3a73711958de2eeeb33b7f69f6 (diff)
downloadmicropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.tar.gz
micropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.zip
py: Make compiler return a proper exception on SyntaxError.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/pyexec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c
index 01c0173ef4..0ce4882e20 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;
}