diff options
author | Damien George <damien.p.george@gmail.com> | 2020-02-11 13:17:41 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-02-13 11:03:37 +1100 |
commit | 97eca38c4f03e76bd464fb25974544a043af2a9e (patch) | |
tree | 9141a63cb6e1e414330d0a93e11ceedc955f4c27 /py/modthread.c | |
parent | 7679e3be96f7e0996faa89678beaf423d7c25999 (diff) |
py: Add mp_raise_type helper macro and use it where appropriate.
This provides a more consistent C-level API to raise exceptions, ie moving
away from nlr_raise towards mp_raise_XXX. It also reduces code size by a
small amount on some ports.
Diffstat (limited to 'py/modthread.c')
-rw-r--r-- | py/modthread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modthread.c b/py/modthread.c index 5a9aba55f..f54bf8344 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -271,7 +271,7 @@ STATIC mp_obj_t mod_thread_start_new_thread(size_t n_args, const mp_obj_t *args) STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_thread_start_new_thread_obj, 2, 3, mod_thread_start_new_thread); STATIC mp_obj_t mod_thread_exit(void) { - nlr_raise(mp_obj_new_exception(&mp_type_SystemExit)); + mp_raise_type(&mp_type_SystemExit); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_thread_exit_obj, mod_thread_exit); |