aboutsummaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-07-27 00:41:27 +1000
committerDamien George <damien@micropython.org>2022-03-10 10:43:21 +1100
commitcac939ddc3625da7e6cf1cf0309daba25fc1cedb (patch)
tree8e0417aab0ea5c9e22d6679edefb6a265cd31ab5 /py/runtime.c
parentbc181550a4790f4dcfaf10e7e61ecfcdf346d5a8 (diff)
py/modsys: Add optional sys.tracebacklimit attribute.
With behaviour as per CPython. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 8c93f539e..665c9f220 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -141,6 +141,10 @@ void mp_init(void) {
MP_STATE_THREAD(current_code_state) = NULL;
#endif
+ #if MICROPY_PY_SYS_TRACEBACKLIMIT
+ MP_STATE_VM(sys_mutable[MP_SYS_MUTABLE_TRACEBACKLIMIT]) = MP_OBJ_NEW_SMALL_INT(1000);
+ #endif
+
#if MICROPY_PY_BLUETOOTH
MP_STATE_VM(bluetooth) = MP_OBJ_NULL;
#endif