diff options
author | Damien George <damien@micropython.org> | 2021-07-27 00:43:35 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-03-10 10:58:33 +1100 |
commit | ac2293161e98e73d39434628f995e85bd97e52c2 (patch) | |
tree | 6cc14ad736b124e085371ec47e734b90f7e98ddd /py/mpconfig.h | |
parent | cac939ddc3625da7e6cf1cf0309daba25fc1cedb (diff) |
py/modsys: Add optional mutable attributes sys.ps1/ps2 and use them.
This allows customising the REPL prompt strings.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index be967e698..47c16ed96 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1356,6 +1356,11 @@ typedef double mp_float_t; #define MICROPY_PY_SYS_ATEXIT (0) #endif +// Whether to provide sys.{ps1,ps2} mutable attributes, to control REPL prompts +#ifndef MICROPY_PY_SYS_PS1_PS2 +#define MICROPY_PY_SYS_PS1_PS2 (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES) +#endif + // Whether to provide "sys.settrace" function #ifndef MICROPY_PY_SYS_SETTRACE #define MICROPY_PY_SYS_SETTRACE (0) @@ -1385,7 +1390,7 @@ typedef double mp_float_t; // Whether the sys module supports attribute delegation // This is enabled automatically when needed by other features #ifndef MICROPY_PY_SYS_ATTR_DELEGATION -#define MICROPY_PY_SYS_ATTR_DELEGATION (MICROPY_PY_SYS_TRACEBACKLIMIT) +#define MICROPY_PY_SYS_ATTR_DELEGATION (MICROPY_PY_SYS_PS1_PS2 || MICROPY_PY_SYS_TRACEBACKLIMIT) #endif // Whether to provide "uerrno" module |