diff options
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index f701e0a8d9..6cb5c7e197 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1189,6 +1189,13 @@ mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_i nlr_raise(module_fun); } + // for compile only + if (MICROPY_PY_BUILTINS_COMPILE && globals == NULL) { + mp_globals_set(old_globals); + mp_locals_set(old_locals); + return module_fun; + } + // complied successfully, execute it nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { |