diff options
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 |