File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ function __init__()
8686 error (" Using Conda.jl python, but location of $python seems to have moved to $(Conda. PYTHONDIR) . Re-run Pkg.build(\" PyCall\" ) and restart Julia." )
8787 end
8888
89+ global libpy_handle
90+
8991 # issue #189
9092 libpy_handle = libpython === nothing ? C_NULL :
9193 Libdl. dlopen (libpython, Libdl. RTLD_LAZY| Libdl. RTLD_GLOBAL)
Original file line number Diff line number Diff line change @@ -125,15 +125,15 @@ if libpython == nothing
125125 end
126126else
127127 macro pysym (func)
128- :(( $ (esc (func)), libpython ))
128+ :(Libdl . dlsym (libpy_handle, $ (esc (func))))
129129 end
130130 macro pyglobal (name)
131- :(cglobal (( $ (esc (name)), libpython )))
131+ :(convert (Ptr{Cvoid}, Libdl . dlsym (libpy_handle, $ (esc (name)))))
132132 end
133133 macro pyglobalobj (name)
134- :(cglobal (( $ (esc (name)), libpython), PyObject_struct ))
134+ :(convert (Ptr{PyObject_struct}, Libdl . dlsym (libpy_handle, $ (esc (name))) ))
135135 end
136136 macro pyglobalobjptr (name)
137- :(unsafe_load (cglobal (( $ (esc (name)), libpython), Ptr{PyObject_struct} )))
137+ :(unsafe_load (convert (Ptr{Ptr{PyObject_struct}}, Libdl . dlsym (libpy_handle, $ (esc (name))) )))
138138 end
139139end
You can’t perform that action at this time.
0 commit comments