Skip to content

Commit

Permalink
Don't eval into the module during precompilation (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jan 27, 2021
1 parent bc1a70d commit 1e7d47c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/PyMNE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ function __init__()
# all of this is __init__() so that it plays nice with precompilation
# see https://github.com/JuliaPy/PyCall.jl/#using-pycall-from-julia-modules
copy!(mne, pyimport("mne"))
# delegate everything else to mne
for pn in propertynames(mne)
isdefined(@__MODULE__, pn) && continue
prop = getproperty(mne, pn)
@eval $pn = $prop
# don't eval into the module while precompiling; this breaks precompilation
# of downstream modules (see #4)
if ccall(:jl_generating_output, Cint, ()) == 0
# delegate everything else to mne
for pn in propertynames(mne)
isdefined(@__MODULE__, pn) && continue
prop = getproperty(mne, pn)
@eval $pn = $prop
end
end
return nothing
end
Expand Down

0 comments on commit 1e7d47c

Please sign in to comment.