diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-13 06:43:18 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-13 07:02:56 +0300 |
commit | 5500cdeec76e5be33f03fe63063a6d0fca40d133 (patch) | |
tree | 1c6caf066491d5f33699d598e26f42d10d4a8585 /unix/file.c | |
parent | 18bef25a0cd99029ebfaa92a29187c56ea96a835 (diff) | |
download | micropython-5500cdeec76e5be33f03fe63063a6d0fca40d133.tar.gz micropython-5500cdeec76e5be33f03fe63063a6d0fca40d133.zip |
py, unix: Convert sys module to static representation.
Diffstat (limited to 'unix/file.c')
-rw-r--r-- | unix/file.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/unix/file.c b/unix/file.c index fa7be791a4..a0a865a263 100644 --- a/unix/file.c +++ b/unix/file.c @@ -146,9 +146,6 @@ mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_open_obj, 1, 2, mp_builtin_open); -void file_init() { - mp_obj_t m_sys = mp_obj_new_module(MP_QSTR_sys); - mp_store_attr(m_sys, MP_QSTR_stdin, fdfile_new(STDIN_FILENO)); - mp_store_attr(m_sys, MP_QSTR_stdout, fdfile_new(STDOUT_FILENO)); - mp_store_attr(m_sys, MP_QSTR_stderr, fdfile_new(STDERR_FILENO)); -} +const mp_obj_fdfile_t mp_sys_stdin_obj = { .base = {&rawfile_type}, .fd = STDIN_FILENO }; +const mp_obj_fdfile_t mp_sys_stdout_obj = { .base = {&rawfile_type}, .fd = STDOUT_FILENO }; +const mp_obj_fdfile_t mp_sys_stderr_obj = { .base = {&rawfile_type}, .fd = STDERR_FILENO }; |