py/mpconfig: Enable module delegation if sys needs it.
Otherwise you can get into the confusing state where e.g. sys.ps1 is enabled in config (via `MICROPY_PY_SYS_PS1_PS2`) but still doesn't actually get enabled. Also verify that the required delegation options are enabled in modsys.c. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
@@ -842,7 +842,7 @@ typedef double mp_float_t;
|
||||
// Whether modules can use MP_REGISTER_MODULE_DELEGATION() to delegate failed
|
||||
// attribute lookups to a custom handler function.
|
||||
#ifndef MICROPY_MODULE_ATTR_DELEGATION
|
||||
#define MICROPY_MODULE_ATTR_DELEGATION (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
|
||||
#define MICROPY_MODULE_ATTR_DELEGATION (MICROPY_PY_SYS_ATTR_DELEGATION || MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
|
||||
#endif
|
||||
|
||||
// Whether to call __init__ when importing builtin modules for the first time.
|
||||
|
||||
Reference in New Issue
Block a user