summaryrefslogtreecommitdiffstatshomepage
path: root/unix/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/file.c')
-rw-r--r--unix/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/file.c b/unix/file.c
index 203a5a3abe..6d59a736ce 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -203,7 +203,7 @@ STATIC mp_obj_t fdfile_open(const mp_obj_type_t *type, mp_arg_val_t *args) {
const char *fname = mp_obj_str_get_str(fid);
int fd = open(fname, mode_x | mode_rw, 0644);
if (fd == -1) {
- nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno)));
+ mp_raise_OSError(errno);
}
o->fd = fd;
return MP_OBJ_FROM_PTR(o);