aboutsummaryrefslogtreecommitdiff
path: root/ports/nrf/modules/uos
diff options
context:
space:
mode:
authorAyke van Laethem2018-07-18 15:25:17 +0200
committerAyke van Laethem2018-07-18 15:25:17 +0200
commit2f0f4fdcd34ecfe16cb9a39bfc070ad8a6329ea0 (patch)
tree4f1e03fcd6568fbebc8d915e8438c349308e84bb /ports/nrf/modules/uos
parent4117a3d672df8686fb06df421bd07d5ce882ae56 (diff)
nrf: Use mp_raise_ValueError instead of nlr_raise(...)
Saves 60 bytes on the nRF52 with SD disabled. There will be a bigger saving with SD enabled and/or on the micro:bit board.
Diffstat (limited to 'ports/nrf/modules/uos')
-rw-r--r--ports/nrf/modules/uos/microbitfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ports/nrf/modules/uos/microbitfs.c b/ports/nrf/modules/uos/microbitfs.c
index 7acc9c52d..928dc5c50 100644
--- a/ports/nrf/modules/uos/microbitfs.c
+++ b/ports/nrf/modules/uos/microbitfs.c
@@ -32,7 +32,6 @@
#include "microbitfs.h"
#include "drivers/flash.h"
#include "modrandom.h"
-#include "py/nlr.h"
#include "py/obj.h"
#include "py/stream.h"
#include "py/runtime.h"
@@ -390,7 +389,7 @@ STATIC mp_obj_t microbit_remove(mp_obj_t filename) {
STATIC void check_file_open(file_descriptor_obj *self) {
if (!self->open) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "I/O operation on closed file"));
+ mp_raise_ValueError("I/O operation on closed file");
}
}
@@ -680,7 +679,7 @@ mp_obj_t uos_mbfs_open(size_t n_args, const mp_obj_t *args) {
}
return res;
mode_error:
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "illegal mode"));
+ mp_raise_ValueError("illegal mode");
}
STATIC mp_obj_t uos_mbfs_stat(mp_obj_t filename) {