diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-24 15:13:07 +0100 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-02-24 15:13:07 +0100 |
| commit | 12fa5b3a66d6f0034113a56c7d647c7bac5be74c (patch) | |
| tree | cc4d5103421f930b7ebaa20eb7d6c8d59c6b6f0d /atmel-samd/moduos.c | |
| parent | efd429464ed82c78fd2e11244a803c7ec2cb2211 (diff) | |
Switch exception throwing to mp_raise helpers. It saves a little code space each time to share the call.
Diffstat (limited to 'atmel-samd/moduos.c')
| -rw-r--r-- | atmel-samd/moduos.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/atmel-samd/moduos.c b/atmel-samd/moduos.c index 33bf7acaf..f30d85ecd 100644 --- a/atmel-samd/moduos.c +++ b/atmel-samd/moduos.c @@ -30,6 +30,7 @@ #include "py/mpstate.h" #include "py/objtuple.h" #include "py/objstr.h" +#include "py/runtime.h" #include "genhdr/mpversion.h" #include "lib/fatfs/ff.h" #include "lib/fatfs/diskio.h" @@ -103,7 +104,7 @@ STATIC mp_obj_t os_getcwd(void) { FRESULT res = f_getcwd(buf, sizeof buf); if (res != FR_OK) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(fresult_to_errno_table[res]))); + mp_raise_OSError(fresult_to_errno_table[res]); } return mp_obj_new_str(buf, strlen(buf), false); |
