aboutsummaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-07-27 00:43:35 +1000
committerDamien George <damien@micropython.org>2022-03-10 10:58:33 +1100
commitac2293161e98e73d39434628f995e85bd97e52c2 (patch)
tree6cc14ad736b124e085371ec47e734b90f7e98ddd /py/mpconfig.h
parentcac939ddc3625da7e6cf1cf0309daba25fc1cedb (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.h7
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