Commit b1b71405 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Dump dl module in favor of ctypes

The module dl has been deprecated, and has been replaced by ctypes. This
also fixes a problem where the dlopen() flags have different numbers in
different architectures.
parent c68ed7e8
...@@ -19,12 +19,7 @@ ...@@ -19,12 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys import sys
try: from DLFCN import RTLD_LAZY, RTLD_GLOBAL
from dl import RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL
except ImportError:
RTLD_LAZY = 1
RTLD_NOW = 2
RTLD_GLOBAL = 256
all = ["dl_import"] all = ["dl_import"]
......
...@@ -21,6 +21,7 @@ import sys, string, hashlib, os.path, re, glob ...@@ -21,6 +21,7 @@ import sys, string, hashlib, os.path, re, glob
from .. import core from .. import core
from .. import libgraph_tool_core from .. import libgraph_tool_core
import numpy import numpy
import DLFCN
try: try:
import scipy.weave import scipy.weave
...@@ -251,7 +252,7 @@ def inline(code, arg_names=None, local_dict=None, ...@@ -251,7 +252,7 @@ def inline(code, arg_names=None, local_dict=None,
# friends to work properly across DSO boundaries. See # friends to work properly across DSO boundaries. See
# http://gcc.gnu.org/faq.html#dso # http://gcc.gnu.org/faq.html#dso
orig_dlopen_flags = sys.getdlopenflags() orig_dlopen_flags = sys.getdlopenflags()
sys.setdlopenflags(core.RTLD_NOW | core.RTLD_GLOBAL) sys.setdlopenflags(DLFCN.RTLD_LAZY | DLFCN.RTLD_GLOBAL)
# call weave and pass all the updated kw arguments # call weave and pass all the updated kw arguments
ret_vals = \ ret_vals = \
......
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