diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-20 00:53:15 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-20 01:00:28 +0200 |
commit | f477bfbc75318b30048b2e68f4d04348eac41105 (patch) | |
tree | c919b72d5d8e1a18f5ecafd119c1d79c2593803a | |
parent | bb33cc66fb51cc4bc4fbcf78279b89061494d7fe (diff) | |
download | micropython-f477bfbc75318b30048b2e68f4d04348eac41105.tar.gz micropython-f477bfbc75318b30048b2e68f4d04348eac41105.zip |
Pre-create sys module.
-rw-r--r-- | py/runtime.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/py/runtime.c b/py/runtime.c index e0d76a517a..f5cea13f52 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -155,8 +155,11 @@ void rt_init(void) { #if MICROPY_CPYTHON_COMPAT // Add (empty) micropython module, so it was possible to "import micropython", // which can be a placeholder module on CPython. - mp_obj_t m = mp_obj_new_module(qstr_from_str_static("micropython")); - rt_store_name(qstr_from_str_static("micropython"), m); + mp_obj_t m_mp = mp_obj_new_module(qstr_from_str_static("micropython")); + rt_store_name(qstr_from_str_static("micropython"), m_mp); + + mp_obj_t m_sys = mp_obj_new_module(qstr_from_str_static("sys")); + rt_store_name(qstr_from_str_static("sys"), m_sys); #endif next_unique_code_id = 1; // 0 indicates "no code" |