Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # We need to enable global symbol visibility for lupa in order to
- # support binary module loading in Lua. If we can enable it here, we
- # do it temporarily.
- def _try_import_with_global_library_symbols():
- import DLFCN
- import sys
- old_flags = sys.getdlopenflags()
- try:
- sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
- import lupa._lupa
- finally:
- sys.setdlopenflags(old_flags)
- try:
- _try_import_with_global_library_symbols()
- except:
- pass
- del _try_import_with_global_library_symbols
- # the following is all that should stay in the namespace:
- from lupa._lupa import *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement