File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919#define MICROPY_OPT_MATH_FACTORIAL (0)
2020#define MICROPY_REPL_EMACS_KEYS (0)
2121#define MICROPY_PY_BUILTINS_COMPLEX (0)
22- #define MICROPY_MODULE_ATTR_DELEGATION (0)
2322#define MICROPY_PY_FUNCTION_ATTRS (0)
2423#define MICROPY_PY_DELATTR_SETATTR (0)
2524#define MICROPY_PY_BUILTINS_STR_CENTER (0)
Original file line number Diff line number Diff line change @@ -195,7 +195,21 @@ STATIC mp_obj_t mp_sys_settrace(mp_obj_t obj) {
195195MP_DEFINE_CONST_FUN_OBJ_1 (mp_sys_settrace_obj , mp_sys_settrace );
196196#endif // MICROPY_PY_SYS_SETTRACE
197197
198+
199+ #if MICROPY_PY_SYS_PS1_PS2 && !MICROPY_PY_SYS_ATTR_DELEGATION
200+ #error "MICROPY_PY_SYS_PS1_PS2 requires MICROPY_PY_SYS_ATTR_DELEGATION"
201+ #endif
202+
203+ #if MICROPY_PY_SYS_TRACEBACKLIMIT && !MICROPY_PY_SYS_ATTR_DELEGATION
204+ #error "MICROPY_PY_SYS_TRACEBACKLIMIT requires MICROPY_PY_SYS_ATTR_DELEGATION"
205+ #endif
206+
207+ #if MICROPY_PY_SYS_ATTR_DELEGATION && !MICROPY_MODULE_ATTR_DELEGATION
208+ #error "MICROPY_PY_SYS_ATTR_DELEGATION requires MICROPY_MODULE_ATTR_DELEGATION"
209+ #endif
210+
198211#if MICROPY_PY_SYS_ATTR_DELEGATION
212+ // Must be kept in sync with the enum at the top of mpstate.h.
199213STATIC const uint16_t sys_mutable_keys [] = {
200214 #if MICROPY_PY_SYS_PS1_PS2
201215 MP_QSTR_ps1 ,
Original file line number Diff line number Diff line change @@ -842,7 +842,7 @@ typedef double mp_float_t;
842842// Whether modules can use MP_REGISTER_MODULE_DELEGATION() to delegate failed
843843// attribute lookups to a custom handler function.
844844#ifndef MICROPY_MODULE_ATTR_DELEGATION
845- #define MICROPY_MODULE_ATTR_DELEGATION (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
845+ #define MICROPY_MODULE_ATTR_DELEGATION (MICROPY_PY_SYS_ATTR_DELEGATION || MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
846846#endif
847847
848848// Whether to call __init__ when importing builtin modules for the first time.
Original file line number Diff line number Diff line change 4040// memory system, runtime and virtual machine. The state is a global
4141// variable, but in the future it is hoped that the state can become local.
4242
43+ #if MICROPY_PY_SYS_ATTR_DELEGATION
44+ // Must be kept in sync with sys_mutable_keys in modsys.c.
4345enum {
4446 #if MICROPY_PY_SYS_PS1_PS2
4547 MP_SYS_MUTABLE_PS1 ,
5052 #endif
5153 MP_SYS_MUTABLE_NUM ,
5254};
55+ #endif // MICROPY_PY_SYS_ATTR_DELEGATION
5356
5457// This structure contains dynamic configuration for the compiler.
5558#if MICROPY_DYNAMIC_COMPILER
You can’t perform that action at this time.
0 commit comments