From 503089ea9d6b358f1a06ad1f164561b7cf11c742 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 7 Oct 2016 14:05:15 +1100 Subject: unix: Use mp_raise_OSError helper function. --- unix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unix/file.c') diff --git a/unix/file.c b/unix/file.c index 203a5a3ab..6d59a736c 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); -- cgit v1.2.3