diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-05 19:01:34 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-05 19:01:34 +0100 |
commit | a91ac2011f0131ce550bf227d78ccccbdab4f882 (patch) | |
tree | 4efcd77de48edbf4017307babe46e9e6b1337c17 /py/builtinevex.c | |
parent | 6dba992182af9b3a73711958de2eeeb33b7f69f6 (diff) | |
download | micropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.tar.gz micropython-a91ac2011f0131ce550bf227d78ccccbdab4f882.zip |
py: Make compiler return a proper exception on SyntaxError.
Diffstat (limited to 'py/builtinevex.c')
-rw-r--r-- | py/builtinevex.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/builtinevex.c b/py/builtinevex.c index 63c1547fbe..a115ec669e 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -64,9 +64,9 @@ STATIC mp_obj_t parse_compile_execute(mp_obj_t o_in, mp_parse_input_kind_t parse // compile the string mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, false); - if (module_fun == mp_const_none) { - // TODO handle compile error correctly - return mp_const_none; + // check if there was a compile error + if (mp_obj_is_exception_instance(module_fun)) { + nlr_raise(module_fun); } // complied successfully, execute it |