diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-21 23:56:37 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-22 00:02:51 +0300 |
commit | acb13886fc837a1bb950d6298c666d29eb2891fc (patch) | |
tree | 299571629b3a54187e2492458a9f9053b7df7a7f /unix/modffi.c | |
parent | dec31bb8725dab3061a99341920b0e391734f2a3 (diff) | |
download | micropython-acb13886fc837a1bb950d6298c666d29eb2891fc.tar.gz micropython-acb13886fc837a1bb950d6298c666d29eb2891fc.zip |
unix: OSError's args[0] should be errno numeric value.
Well, Python3 also defines an attribute for that, but that's bloat.
Diffstat (limited to 'unix/modffi.c')
-rw-r--r-- | unix/modffi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unix/modffi.c b/unix/modffi.c index 9dfc442b55..f00b90f879 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -145,7 +145,7 @@ STATIC mp_obj_t ffimod_func(uint n_args, const mp_obj_t *args) { void *sym = dlsym(self->handle, symname); if (sym == NULL) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "[Errno %d]", errno)); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno))); } int nparams = MP_OBJ_SMALL_INT_VALUE(mp_obj_len_maybe(args[3])); mp_obj_ffifunc_t *o = m_new_obj_var(mp_obj_ffifunc_t, ffi_type*, nparams); @@ -219,7 +219,7 @@ STATIC mp_obj_t ffimod_var(mp_obj_t self_in, mp_obj_t vartype_in, mp_obj_t symna void *sym = dlsym(self->handle, symname); if (sym == NULL) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "[Errno %d]", errno)); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno))); } mp_obj_ffivar_t *o = m_new_obj(mp_obj_ffivar_t); o->base.type = &ffivar_type; @@ -235,7 +235,7 @@ STATIC mp_obj_t ffimod_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const void *mod = dlopen(fname, RTLD_NOW | RTLD_LOCAL); if (mod == NULL) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "[Errno %d]", errno)); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno))); } mp_obj_ffimod_t *o = m_new_obj(mp_obj_ffimod_t); o->base.type = type_in; |