only dlopen() once

This commit is contained in:
2025-06-01 08:08:04 -07:00
parent e1202ab4fe
commit da66f525d8

2
bash.h
View File

@ -29,8 +29,8 @@ extern char **make_builtin_argv(WORD_LIST*, int*);
#define PY_FUNC(bash_name, modname, function) \
int bash_name(int argc, char **argv) { \
dlopen("libpython3.13.so", RTLD_NOW | RTLD_GLOBAL);\
if (!Py_IsInitialized()) { \
dlopen("libpython3.13.so", RTLD_NOW | RTLD_GLOBAL);\
PyImport_AppendInittab(#modname, PyInit_##modname); \
Py_Initialize(); \
} \