File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77#include "py/runtime.h"
88#include "py/repl.h"
99#include "py/gc.h"
10+ #include "py/mperrno.h"
1011#include "lib/utils/pyexec.h"
1112
1213#if MICROPY_ENABLE_COMPILER
1314void do_str (const char * src , mp_parse_input_kind_t input_kind ) {
14- mp_lexer_t * lex = mp_lexer_new_from_str_len (MP_QSTR__lt_stdin_gt_ , src , strlen (src ), 0 );
15- if (lex == NULL ) {
16- printf ("MemoryError: lexer could not allocate memory\n" );
17- return ;
18- }
19-
2015 nlr_buf_t nlr ;
2116 if (nlr_push (& nlr ) == 0 ) {
17+ mp_lexer_t * lex = mp_lexer_new_from_str_len (MP_QSTR__lt_stdin_gt_ , src , strlen (src ), 0 );
2218 qstr source_name = lex -> source_name ;
2319 mp_parse_tree_t parse_tree = mp_parse (lex , input_kind );
2420 mp_obj_t module_fun = mp_compile (& parse_tree , source_name , MP_EMIT_OPT_NONE , true);
@@ -74,7 +70,7 @@ void gc_collect(void) {
7470}
7571
7672mp_lexer_t * mp_lexer_new_from_file (const char * filename ) {
77- return NULL ;
73+ mp_raise_OSError ( MP_ENOENT ) ;
7874}
7975
8076mp_import_stat_t mp_import_stat (const char * path ) {
You can’t perform that action at this time.
0 commit comments