Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pyinit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ function __init__()
error("Using Conda.jl python, but location of $python seems to have moved to $(Conda.PYTHONDIR). Re-run Pkg.build(\"PyCall\") and restart Julia.")
end

global libpy_handle

# issue #189
libpy_handle = libpython === nothing ? C_NULL :
Libdl.dlopen(libpython, Libdl.RTLD_LAZY|Libdl.RTLD_GLOBAL)
Expand Down
8 changes: 4 additions & 4 deletions src/startup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ if libpython == nothing
end
else
macro pysym(func)
:(($(esc(func)), libpython))
:(Libdl.dlsym(libpy_handle, $(esc(func))))
end
macro pyglobal(name)
:(cglobal(($(esc(name)), libpython)))
:(convert(Ptr{Cvoid}, Libdl.dlsym(libpy_handle, $(esc(name)))))
end
macro pyglobalobj(name)
:(cglobal(($(esc(name)), libpython), PyObject_struct))
:(convert(Ptr{PyObject_struct}, Libdl.dlsym(libpy_handle, $(esc(name)))))
end
macro pyglobalobjptr(name)
:(unsafe_load(cglobal(($(esc(name)), libpython), Ptr{PyObject_struct})))
:(unsafe_load(convert(Ptr{Ptr{PyObject_struct}}, Libdl.dlsym(libpy_handle, $(esc(name))))))
end
end