Commit deaeaac4 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

modsys: Enable sys.exit() per port after all.

parent 37b0f335
...@@ -55,8 +55,10 @@ STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0"); ...@@ -55,8 +55,10 @@ STATIC const MP_DEFINE_STR_OBJ(version_obj, "3.4.0");
STATIC const mp_map_elem_t mp_module_sys_globals_table[] = { 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___name__), MP_OBJ_NEW_QSTR(MP_QSTR_sys) },
#if MICROPY_SYS_EXIT
// Should be implemented by port // Should be implemented by port
{ MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_exit), (mp_obj_t)&mp_sys_exit_obj },
#endif
{ MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj }, { 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_argv), (mp_obj_t)&mp_sys_argv_obj },
......
...@@ -229,6 +229,11 @@ typedef double mp_float_t; ...@@ -229,6 +229,11 @@ typedef double mp_float_t;
#define MICROPY_MOD_SYS_STDFILES (0) #define MICROPY_MOD_SYS_STDFILES (0)
#endif #endif
// sys.exit() availability
#ifndef MICROPY_SYS_EXIT
#define MICROPY_SYS_EXIT (0)
#endif
// Whether to support slice object and correspondingly // Whether to support slice object and correspondingly
// slice subscript operators // slice subscript operators
#ifndef MICROPY_ENABLE_SLICE #ifndef MICROPY_ENABLE_SLICE
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#define MICROPY_ENABLE_LFN (1) #define MICROPY_ENABLE_LFN (1)
#define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */ #define MICROPY_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
#define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_SYS_EXIT (1)
#define MICROPY_ENABLE_MOD_CMATH (1) #define MICROPY_ENABLE_MOD_CMATH (1)
// extra built in names to add to the global namespace // extra built in names to add to the global namespace
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define MICROPY_USE_COMPUTED_GOTO (1) #define MICROPY_USE_COMPUTED_GOTO (1)
#define MICROPY_MOD_SYS_STDFILES (1) #define MICROPY_MOD_SYS_STDFILES (1)
#define MICROPY_ENABLE_MOD_CMATH (1) #define MICROPY_ENABLE_MOD_CMATH (1)
#define MICROPY_SYS_EXIT (1)
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc. // Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
// names in exception messages (may require more RAM). // names in exception messages (may require more RAM).
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment