py/modsys: Add optional sys.tracebacklimit attribute.

With behaviour as per CPython.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2021-07-27 00:41:27 +10:00
parent bc181550a4
commit cac939ddc3
10 changed files with 117 additions and 3 deletions

View File

@@ -185,6 +185,9 @@ MP_DEFINE_CONST_FUN_OBJ_1(mp_sys_settrace_obj, mp_sys_settrace);
#if MICROPY_PY_SYS_ATTR_DELEGATION
STATIC const uint16_t sys_mutable_keys[] = {
#if MICROPY_PY_SYS_TRACEBACKLIMIT
MP_QSTR_tracebacklimit,
#endif
MP_QSTRnull,
};