diff options
| -rw-r--r-- | shared/runtime/pyexec.c | 5 | ||||
| -rw-r--r-- | shared/runtime/pyexec.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c index 9dc4446ed..c828c7581 100644 --- a/shared/runtime/pyexec.c +++ b/shared/runtime/pyexec.c @@ -720,6 +720,11 @@ int pyexec_frozen_module(const char *name, bool allow_keyboard_interrupt) { } #endif +int pyexec_vstr(vstr_t *str, bool allow_keyboard_interrupt) { + mp_uint_t exec_flags = allow_keyboard_interrupt ? 0 : EXEC_FLAG_NO_INTERRUPT; + return parse_compile_execute(str, MP_PARSE_FILE_INPUT, exec_flags | EXEC_FLAG_SOURCE_IS_VSTR); +} + #if MICROPY_REPL_INFO mp_obj_t pyb_set_repl_info(mp_obj_t o_value) { repl_display_debugging_info = mp_obj_get_int(o_value); diff --git a/shared/runtime/pyexec.h b/shared/runtime/pyexec.h index 5779d3e09..95f448162 100644 --- a/shared/runtime/pyexec.h +++ b/shared/runtime/pyexec.h @@ -42,6 +42,7 @@ int pyexec_friendly_repl(void); int pyexec_file(const char *filename); int pyexec_file_if_exists(const char *filename); int pyexec_frozen_module(const char *name, bool allow_keyboard_interrupt); +int pyexec_vstr(vstr_t *str, bool allow_keyboard_interrupt); void pyexec_event_repl_init(void); int pyexec_event_repl_process_char(int c); extern uint8_t pyexec_repl_active; |
