summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-20 01:57:20 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-01-20 01:57:20 +0200
commit159c0f75da698bf6d712ab334022f16f89e51593 (patch)
treecd49c8e4f0ab99f9c607ffe10997a3000f9e8223
parentfe2690da0a1b8556995f5a6d2368d250f504b4af (diff)
downloadmicropython-159c0f75da698bf6d712ab334022f16f89e51593.tar.gz
micropython-159c0f75da698bf6d712ab334022f16f89e51593.zip
Don't implicitly import "sys" module.
-rw-r--r--py/runtime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/runtime.c b/py/runtime.c
index f5cea13f52..830bcc6aa8 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -158,8 +158,8 @@ void rt_init(void) {
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);
+ // Precreate sys module, so "import sys" didn't throw exceptions.
+ mp_obj_new_module(qstr_from_str_static("sys"));
#endif
next_unique_code_id = 1; // 0 indicates "no code"