commit | d0f5e61ab58892ecd3b0838adeea3cde330da3f1 | [log] [tgz] |
---|---|---|
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | Fri Jul 25 11:00:15 2014 +0300 |
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | Mon Jul 28 21:21:59 2014 +0300 |
tree | 670466ad2dd5bda38156c7b584ab9e1b28fec6e3 | |
parent | 645582fe14b10daa938bcabd86054ea23ea9eb08 [diff] [blame] |
py: Implement __file__ attribute for modules.
diff --git a/unix/main.c b/unix/main.c index d0222de..03718c2 100644 --- a/unix/main.c +++ b/unix/main.c
@@ -95,6 +95,11 @@ } qstr source_name = mp_lexer_source_name(lex); + #if MICROPY_PY___FILE__ + if (input_kind == MP_PARSE_FILE_INPUT) { + mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name)); + } + #endif mp_lexer_free(lex); /*