diff options
| author | microDev <70126934+microDev1@users.noreply.github.com> | 2020-11-24 11:11:11 +0530 |
|---|---|---|
| committer | microDev <70126934+microDev1@users.noreply.github.com> | 2020-11-24 11:11:11 +0530 |
| commit | 9dd1783da547bf9d632fa307abcf42f36d260ccf (patch) | |
| tree | 1c2df3a5e6c96dfb63574bf12ca5d8edd32236f3 /py/modsys.c | |
| parent | 040eaa044344562ec1f9905d67b612ea2ec12949 (diff) | |
| parent | ebdc48ae22589080300da249f416bd55f1c121bd (diff) | |
Merge branch 'main' into ps2io-S2
Diffstat (limited to 'py/modsys.c')
| -rw-r--r-- | py/modsys.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/py/modsys.c b/py/modsys.c index a1d2cf831..81628683d 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -92,13 +92,11 @@ STATIC const MP_DEFINE_STR_OBJ(platform_obj, MICROPY_PY_SYS_PLATFORM); // exit([retval]): raise SystemExit, with optional argument given to the exception STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) { - mp_obj_t exc; if (n_args == 0) { - exc = mp_obj_new_exception(&mp_type_SystemExit); + nlr_raise(mp_obj_new_exception(&mp_type_SystemExit)); } else { - exc = mp_obj_new_exception_arg1(&mp_type_SystemExit, args[0]); + mp_raise_arg1(&mp_type_SystemExit, args[0]); } - nlr_raise(exc); } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit); |
