summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-01-21 00:36:32 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-01-21 00:38:06 +0200
commit0ab3fc3805282cc733bdf7a5970ec37e3160beee (patch)
treed7e82c0b7837aa92468e94147a108bcbf7739f59
parent50149a573063dc4a1a6541686e61c310d5fc8353 (diff)
downloadmicropython-0ab3fc3805282cc733bdf7a5970ec37e3160beee.tar.gz
micropython-0ab3fc3805282cc733bdf7a5970ec37e3160beee.zip
modffi: Support open own executable using open(None).
-rw-r--r--unix/modffi.c5
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) {