Skip to content

Commit 0ab3fc3

Browse files
committed
modffi: Support open own executable using open(None).
1 parent 50149a5 commit 0ab3fc3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

unix/modffi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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_
272272
(void)n_args;
273273
(void)n_kw;
274274

275-
const char *fname = mp_obj_str_get_str(args[0]);
275+
const char *fname = NULL;
276+
if (args[0] != mp_const_none) {
277+
fname = mp_obj_str_get_str(args[0]);
278+
}
276279
void *mod = dlopen(fname, RTLD_NOW | RTLD_LOCAL);
277280

278281
if (mod == NULL) {

0 commit comments

Comments
 (0)