Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
c1ed1839
Commit
c1ed1839
authored
Dec 29, 2011
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fall back to ctypes if the DLFCN or dl modules are not available
parent
d874dec6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
src/graph_tool/dl_import.py
src/graph_tool/dl_import.py
+9
-3
src/graph_tool/run_action/inline.py
src/graph_tool/run_action/inline.py
+2
-2
No files found.
src/graph_tool/dl_import.py
View file @
c1ed1839
...
...
@@ -21,10 +21,16 @@
import
sys
try
:
from
DLFCN
import
RTLD_LAZY
,
RTLD_GLOBAL
dl_flags
=
RTLD_LAZY
|
RTLD_GLOBAL
except
ImportError
:
# handle strange python installations, by importing from the deprecated dl
# module
from
dl
import
RTLD_LAZY
,
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"
]
...
...
@@ -41,7 +47,7 @@ def dl_import(import_expr):
# work properly across DSO boundaries. See http://gcc.gnu.org/faq.html#dso
orig_dlopen_flags
=
sys
.
getdlopenflags
()
sys
.
setdlopenflags
(
RTLD_LAZY
|
RTLD_GLOBAL
)
sys
.
setdlopenflags
(
dl_flags
)
exec
import_expr
in
local_dict
,
global_dict
...
...
src/graph_tool/run_action/inline.py
View file @
c1ed1839
...
...
@@ -21,7 +21,7 @@ import sys, string, hashlib, os.path, re, glob
from
..
import
*
from
..
import
libgraph_tool_core
import
numpy
from
..
dl_import
import
RTLD_LAZY
,
RTLD_GLOBAL
from
..
dl_import
import
dl_flags
try
:
import
scipy.weave
...
...
@@ -251,7 +251,7 @@ def inline(code, arg_names=None, local_dict=None,
# friends to work properly across DSO boundaries. See
# http://gcc.gnu.org/faq.html#dso
orig_dlopen_flags
=
sys
.
getdlopenflags
()
sys
.
setdlopenflags
(
RTLD_LAZY
|
RTLD_GLOBAL
)
sys
.
setdlopenflags
(
dl_flags
)
# call weave and pass all the updated kw arguments
ret_vals
=
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment