diff options
-rw-r--r-- | examples/embedding/mpconfigport.h | 1 | ||||
-rw-r--r-- | ports/bare-arm/mpconfigport.h | 3 | ||||
-rw-r--r-- | ports/minimal/mpconfigport.h | 6 | ||||
-rw-r--r-- | ports/nrf/mpconfigport.h | 1 | ||||
-rw-r--r-- | ports/powerpc/mpconfigport.h | 1 | ||||
-rw-r--r-- | ports/unix/variants/minimal/mpconfigvariant.h | 3 | ||||
-rw-r--r-- | ports/zephyr/mpconfigport_minimal.h | 1 | ||||
-rw-r--r-- | py/mpconfig.h | 2 |
8 files changed, 12 insertions, 6 deletions
diff --git a/examples/embedding/mpconfigport.h b/examples/embedding/mpconfigport.h index ed34a5d76..b7a38aa81 100644 --- a/examples/embedding/mpconfigport.h +++ b/examples/embedding/mpconfigport.h @@ -13,3 +13,4 @@ #define MICROPY_ENABLE_COMPILER (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_PY_GC (1) +#define MICROPY_PY_SYS (0) diff --git a/ports/bare-arm/mpconfigport.h b/ports/bare-arm/mpconfigport.h index 65bb67f7b..f4b87f23e 100644 --- a/ports/bare-arm/mpconfigport.h +++ b/ports/bare-arm/mpconfigport.h @@ -37,6 +37,9 @@ // Python internal features #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NONE) +// Fine control over Python builtins, classes, modules, etc. +#define MICROPY_PY_SYS (0) + // Type definitions for the specific machine typedef int32_t mp_int_t; // must be pointer size diff --git a/ports/minimal/mpconfigport.h b/ports/minimal/mpconfigport.h index 87287cbc6..b542c124d 100644 --- a/ports/minimal/mpconfigport.h +++ b/ports/minimal/mpconfigport.h @@ -21,6 +21,12 @@ // Use the minimum headroom in the chunk allocator for parse nodes. #define MICROPY_ALLOC_PARSE_CHUNK_INIT (16) +// Disable all optional sys module features. +#define MICROPY_PY_SYS_MODULES (0) +#define MICROPY_PY_SYS_EXIT (0) +#define MICROPY_PY_SYS_PATH (0) +#define MICROPY_PY_SYS_ARGV (0) + // type definitions for the specific machine typedef intptr_t mp_int_t; // must be pointer size diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index d944fc8a1..d361d01cc 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -289,7 +289,6 @@ #define MICROPY_PY_GENERATOR_PEND_THROW (1) #define MICROPY_PY_MATH (1) #define MICROPY_PY_STRUCT (1) -#define MICROPY_PY_SYS (1) #define MICROPY_PY_SYS_PATH_ARGV_DEFAULTS (1) #endif diff --git a/ports/powerpc/mpconfigport.h b/ports/powerpc/mpconfigport.h index 091e94bda..fcb66bab1 100644 --- a/ports/powerpc/mpconfigport.h +++ b/ports/powerpc/mpconfigport.h @@ -81,7 +81,6 @@ #define MICROPY_PY_CMATH (0) #define MICROPY_PY_IO (0) #define MICROPY_PY_STRUCT (1) -#define MICROPY_PY_SYS (1) #define MICROPY_MODULE_FROZEN_MPY (1) #define MICROPY_CPYTHON_COMPAT (0) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) diff --git a/ports/unix/variants/minimal/mpconfigvariant.h b/ports/unix/variants/minimal/mpconfigvariant.h index 97ed786b8..2edac41c7 100644 --- a/ports/unix/variants/minimal/mpconfigvariant.h +++ b/ports/unix/variants/minimal/mpconfigvariant.h @@ -61,6 +61,5 @@ #define MICROPY_PY_BUILTINS_RANGE_ATTRS (1) #define MICROPY_PY_GENERATOR_PEND_THROW (1) -// Enable just the sys and os built-in modules. -#define MICROPY_PY_SYS (1) +// Add just the os built-in module. #define MICROPY_PY_OS (1) diff --git a/ports/zephyr/mpconfigport_minimal.h b/ports/zephyr/mpconfigport_minimal.h index 24e0c9f1a..c802ba525 100644 --- a/ports/zephyr/mpconfigport_minimal.h +++ b/ports/zephyr/mpconfigport_minimal.h @@ -59,7 +59,6 @@ #define MICROPY_PY_BUILTINS_STR_OP_MODULO (1) #define MICROPY_PY_BUILTINS_BYTEARRAY (1) #define MICROPY_PY_BUILTINS_DICT_FROMKEYS (1) -#define MICROPY_PY_SYS (1) #ifdef CONFIG_BOARD #define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD diff --git a/py/mpconfig.h b/py/mpconfig.h index 877b262c8..303eb08f9 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1610,7 +1610,7 @@ typedef time_t mp_timestamp_t; // Whether to provide "sys" module #ifndef MICROPY_PY_SYS -#define MICROPY_PY_SYS (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES) +#define MICROPY_PY_SYS (1) #endif // Whether to initialise "sys.path" and "sys.argv" to their defaults in mp_init() |