mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
unix: Use mp_raise_OSError helper function.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user