diff options
author | Damien George <damien.p.george@gmail.com> | 2014-02-05 21:27:05 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-02-05 21:27:05 +0000 |
commit | cdcb4906d41f42789f6610047e8ae6aa79a61e47 (patch) | |
tree | 099453009838e4ba11de4a32cda89f076dc20256 /py/runtime.c | |
parent | b8ec17c2d16407dd186d1f8f76c1e7c420bb7729 (diff) | |
parent | 911089606376e60bd9451a85eb9558a23cde9039 (diff) |
Merge pull request #262 from pfalcon/sys-path
Implement sys.path support
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/py/runtime.c b/py/runtime.c index 9327f0d6a..fc18c0151 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -169,8 +169,14 @@ void rt_init(void) { #if MICROPY_CPYTHON_COMPAT // Precreate sys module, so "import sys" didn't throw exceptions. - mp_obj_new_module(MP_QSTR_sys); + mp_obj_t m_sys = mp_obj_new_module(MP_QSTR_sys); + // Avoid warning of unused var + (void)m_sys; #endif + // init sys.path + // for efficiency, left to platform-specific startup code + //sys_path = mp_obj_new_list(0, NULL); + //rt_store_attr(m_sys, MP_QSTR_path, sys_path); mp_module_micropython_init(); |