summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
Diffstat (limited to 'extmod')
-rw-r--r--extmod/machine_mem.c2
-rw-r--r--extmod/moduheapq.c2
-rw-r--r--extmod/vfs_posix_file.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/extmod/machine_mem.c b/extmod/machine_mem.c
index 6c6e11063..8944c3a66 100644
--- a/extmod/machine_mem.c
+++ b/extmod/machine_mem.c
@@ -21,7 +21,7 @@
STATIC uintptr_t machine_mem_get_addr(mp_obj_t addr_o, uint align) {
uintptr_t addr = mp_obj_int_get_truncated(addr_o);
if ((addr & (align - 1)) != 0) {
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, translate("address %08x is not aligned to %d bytes"), addr, align));
+ mp_raise_ValueError_varg(translate("address %08x is not aligned to %d bytes"), addr, align);
}
return addr;
}
diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c
index bc4b97ff5..50fe6c051 100644
--- a/extmod/moduheapq.c
+++ b/extmod/moduheapq.c
@@ -62,7 +62,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_uheapq_heappush_obj, mod_uheapq_heappush);
STATIC mp_obj_t mod_uheapq_heappop(mp_obj_t heap_in) {
mp_obj_list_t *heap = get_heap(heap_in);
if (heap->len == 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, translate("empty heap")));
+ mp_raise_IndexError(translate("empty heap"));
}
mp_obj_t item = heap->items[0];
heap->len -= 1;
diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c
index 3f887785e..593b8d6a2 100644
--- a/extmod/vfs_posix_file.c
+++ b/extmod/vfs_posix_file.c
@@ -24,7 +24,7 @@ typedef struct _mp_obj_vfs_posix_file_t {
#ifdef MICROPY_CPYTHON_COMPAT
STATIC void check_fd_is_open(const mp_obj_vfs_posix_file_t *o) {
if (o->fd < 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, translate("I/O operation on closed file")));
+ mp_raise_ValueError(translate("I/O operation on closed file"));
}
}
#else