We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dc2600 commit 1532863Copy full SHA for 1532863
1 file changed
lib/utils/pyexec.c
@@ -89,6 +89,9 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
89
}
90
// source is a lexer, parse and compile the script
91
qstr source_name = lex->source_name;
92
+ if (input_kind == MP_PARSE_FILE_INPUT) {
93
+ mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name));
94
+ }
95
mp_parse_tree_t parse_tree = mp_parse(lex, input_kind);
96
module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL);
97
// Clear the parse tree because it has a heap pointer we don't need anymore.
0 commit comments