Commit c04533b0 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix dlopen() flags problem with Python 3.6

parent 99d8d449
Pipeline #241 failed with stage
in 181 minutes and 10 seconds
...@@ -24,17 +24,21 @@ import sys ...@@ -24,17 +24,21 @@ import sys
import os.path import os.path
try: try:
from DLFCN import RTLD_LAZY, RTLD_GLOBAL from os import RTLD_LAZY, RTLD_GLOBAL
dl_flags = RTLD_LAZY | RTLD_GLOBAL dl_flags = RTLD_LAZY | RTLD_GLOBAL
except ImportError: except ImportError:
# handle strange python installations, by importing from the deprecated dl
# module, otherwise from ctypes
try: try:
from dl import RTLD_LAZY, RTLD_GLOBAL from DLFCN import RTLD_LAZY, RTLD_GLOBAL
dl_flags = RTLD_LAZY | RTLD_GLOBAL dl_flags = RTLD_LAZY | RTLD_GLOBAL
except ImportError: except ImportError:
from ctypes import RTLD_GLOBAL # handle strange python installations, by importing from the deprecated dl
dl_flags = RTLD_GLOBAL # module, otherwise from ctypes
try:
from dl import RTLD_LAZY, RTLD_GLOBAL
dl_flags = RTLD_LAZY | RTLD_GLOBAL
except ImportError:
from ctypes import RTLD_GLOBAL
dl_flags = RTLD_GLOBAL
__all__ = ["dl_import"] __all__ = ["dl_import"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment