modffi: Support open own executable using open(None).
This commit is contained in:
parent
50149a5730
commit
0ab3fc3805
@ -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_args;
|
||||||
(void)n_kw;
|
(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);
|
void *mod = dlopen(fname, RTLD_NOW | RTLD_LOCAL);
|
||||||
|
|
||||||
if (mod == NULL) {
|
if (mod == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user