aboutsummaryrefslogtreecommitdiff
path: root/py/builtinevex.c
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 /py/builtinevex.c
parent6dba992182af9b3a73711958de2eeeb33b7f69f6 (diff)
py: Make compiler return a proper exception on SyntaxError.
Diffstat (limited to 'py/builtinevex.c')
-rw-r--r--py/builtinevex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/builtinevex.c b/py/builtinevex.c
index 63c1547fb..a115ec669 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