mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
py: Make compiler return a proper exception on SyntaxError.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user