Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d240ff83
Commit
d240ff83
authored
Apr 13, 2014
by
Damien George
Browse files
Merge branch 'master' of github.com:micropython/micropython
parents
b502156e
978d2c02
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/modsys.c
View file @
d240ff83
...
...
@@ -5,6 +5,7 @@
#include
"builtin.h"
#include
"runtime.h"
#include
"objlist.h"
#include
"objtuple.h"
#if MICROPY_ENABLE_MOD_SYS
...
...
@@ -17,11 +18,21 @@ extern struct _dummy_t mp_sys_stderr_obj;
mp_obj_list_t
mp_sys_path_obj
;
mp_obj_list_t
mp_sys_argv_obj
;
#define I(n) MP_OBJ_NEW_SMALL_INT(n)
// TODO: CPython is now at 5-element array, but save 2 els so far...
STATIC
const
mp_obj_tuple_t
mp_sys_version_info_obj
=
{{
&
mp_type_tuple
},
3
,
{
I
(
3
),
I
(
3
),
I
(
5
)}};
#undef I
STATIC
const
mp_map_elem_t
mp_module_sys_globals_table
[]
=
{
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_sys
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_path
),
(
mp_obj_t
)
&
mp_sys_path_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_argv
),
(
mp_obj_t
)
&
mp_sys_argv_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_version_info
),
(
mp_obj_t
)
&
mp_sys_version_info_obj
},
#if MP_ENDIANNESS_LITTLE
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_byteorder
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_little
)
},
#else
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_byteorder
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_big
)
},
#endif
#if MICROPY_MOD_SYS_STDFILES
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_stdin
),
(
mp_obj_t
)
&
mp_sys_stdin_obj
},
...
...
py/qstrdefs.h
View file @
d240ff83
...
...
@@ -273,7 +273,11 @@ Q(utf-8)
#if MICROPY_ENABLE_MOD_SYS
Q
(
argv
)
Q
(
byteorder
)
Q
(
big
)
Q
(
little
)
Q
(
stdin
)
Q
(
stdout
)
Q
(
stderr
)
Q
(
version_info
)
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment