Browse Source

Merge branch 'master' of github.com:micropython/micropython

Conflicts:
	py/emitglue.c
pull/675/head
Damien George 11 years ago
parent
commit
d31a093f9c
  1. 6
      py/modsys.c
  2. 6
      py/objtype.c
  3. 4
      py/qstrdefs.h
  4. 4
      py/runtime.c
  5. 3
      py/runtime.h
  6. 1
      unix/mpconfigport.h

6
py/modsys.c

@ -51,6 +51,9 @@ mp_obj_list_t mp_sys_argv_obj;
STATIC const mp_obj_tuple_t mp_sys_version_info_obj = {{&mp_type_tuple}, 3, {I(3), I(4), I(0)}};
#undef I
STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
#ifdef MICROPY_PY_SYS_PLATFORM
STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM);
#endif
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) },
@ -59,6 +62,9 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_argv), (mp_obj_t)&mp_sys_argv_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_version), (mp_obj_t)&version_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_version_info), (mp_obj_t)&mp_sys_version_info_obj },
#ifdef MICROPY_PY_SYS_PLATFORM
{ MP_OBJ_NEW_QSTR(MP_QSTR_platform), (mp_obj_t)&platform_obj },
#endif
#if MP_ENDIANNESS_LITTLE
{ MP_OBJ_NEW_QSTR(MP_QSTR_byteorder), MP_OBJ_NEW_QSTR(MP_QSTR_little) },
#else

6
py/objtype.c

@ -336,9 +336,9 @@ STATIC const qstr binary_op_method_name[] = {
MP_BINARY_OP_INPLACE_FLOOR_DIVIDE,
MP_BINARY_OP_INPLACE_TRUE_DIVIDE,
MP_BINARY_OP_INPLACE_MODULO,
MP_BINARY_OP_INPLACE_POWER,
MP_BINARY_OP_LESS,
MP_BINARY_OP_MORE,
MP_BINARY_OP_INPLACE_POWER,*/
[MP_BINARY_OP_LESS] = MP_QSTR___lt__,
/*MP_BINARY_OP_MORE,
MP_BINARY_OP_EQUAL,
MP_BINARY_OP_LESS_EQUAL,
MP_BINARY_OP_MORE_EQUAL,

4
py/qstrdefs.h

@ -60,6 +60,7 @@ Q(__str__)
Q(__getattr__)
Q(__del__)
Q(__call__)
Q(__lt__)
Q(micropython)
Q(bytecode)
@ -343,6 +344,9 @@ Q(byteorder)
Q(big)
Q(exit)
Q(little)
#ifdef MICROPY_PY_SYS_PLATFORM
Q(platform)
#endif
Q(stdin)
Q(stdout)
Q(stderr)

4
py/runtime.c

@ -1150,6 +1150,10 @@ void *m_malloc_fail(int num_bytes) {
nlr_raise((mp_obj_t)&mp_const_MemoryError_obj);
}
NORETURN void mp_not_implemented(const char *msg) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, msg));
}
// these must correspond to the respective enum
void *const mp_fun_table[MP_F_NUMBER_OF] = {
mp_load_const_int,

3
py/runtime.h

@ -112,6 +112,9 @@ mp_obj_t mp_import_name(qstr name, mp_obj_t fromlist, mp_obj_t level);
mp_obj_t mp_import_from(mp_obj_t module, qstr name);
void mp_import_all(mp_obj_t module);
// Raise NotImplementedError with given message
NORETURN void mp_not_implemented(const char *msg);
extern struct _mp_obj_list_t mp_sys_path_obj;
extern struct _mp_obj_list_t mp_sys_argv_obj;
#define mp_sys_path ((mp_obj_t)&mp_sys_path_obj)

1
unix/mpconfigport.h

@ -43,6 +43,7 @@
#define MICROPY_OPT_COMPUTED_GOTO (1)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_PLATFORM "linux"
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_FILEIO (1)

Loading…
Cancel
Save