summaryrefslogtreecommitdiffstatshomepage
path: root/unix/modmachine.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-07 14:05:15 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-07 14:05:15 +1100
commit503089ea9d6b358f1a06ad1f164561b7cf11c742 (patch)
treec206ac1372a24d5f6da17e0d33cc30c9c7df0c93 /unix/modmachine.c
parent23a568240d9fb216c5f2ca9feeb3134725c9eea0 (diff)
downloadmicropython-503089ea9d6b358f1a06ad1f164561b7cf11c742.tar.gz
micropython-503089ea9d6b358f1a06ad1f164561b7cf11c742.zip
unix: Use mp_raise_OSError helper function.
Diffstat (limited to 'unix/modmachine.c')
-rw-r--r--unix/modmachine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/modmachine.c b/unix/modmachine.c
index 1b62b68c34..e5f9ec8d70 100644
--- a/unix/modmachine.c
+++ b/unix/modmachine.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <stdint.h>
-#include "py/nlr.h"
+#include "py/runtime.h"
#include "py/obj.h"
#include "extmod/machine_mem.h"
@@ -58,7 +58,7 @@ uintptr_t mod_machine_mem_get_addr(mp_obj_t addr_o, uint align) {
if (!fd) {
fd = open("/dev/mem", O_RDWR | O_SYNC);
if (fd == -1) {
- nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno)));
+ mp_raise_OSError(errno);
}
}