diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-01-21 00:36:32 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-01-21 00:38:06 +0200 |
commit | 0ab3fc3805282cc733bdf7a5970ec37e3160beee (patch) | |
tree | d7e82c0b7837aa92468e94147a108bcbf7739f59 | |
parent | 50149a573063dc4a1a6541686e61c310d5fc8353 (diff) | |
download | micropython-0ab3fc3805282cc733bdf7a5970ec37e3160beee.tar.gz micropython-0ab3fc3805282cc733bdf7a5970ec37e3160beee.zip |
modffi: Support open own executable using open(None).
-rw-r--r-- | unix/modffi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unix/modffi.c b/unix/modffi.c index fc218caf17..cf5d5eb2e1 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -272,7 +272,10 @@ STATIC mp_obj_t ffimod_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_ (void)n_args; (void)n_kw; - const char *fname = mp_obj_str_get_str(args[0]); + const char *fname = NULL; + if (args[0] != mp_const_none) { + fname = mp_obj_str_get_str(args[0]); + } void *mod = dlopen(fname, RTLD_NOW | RTLD_LOCAL); if (mod == NULL) { |