diff --git a/src/PythonCall.jl b/src/PythonCall.jl index 22f7e25e..9c7084d0 100644 --- a/src/PythonCall.jl +++ b/src/PythonCall.jl @@ -83,6 +83,8 @@ include("compat/ipython.jl") include("compat/tables.jl") function __init__() + ccall(:jl_generating_output, Cint, ()) == 1 && return nothing + C.with_gil() do init_consts() init_pyconvert() diff --git a/src/cpython/CPython.jl b/src/cpython/CPython.jl index 2cb671f6..c5030728 100644 --- a/src/cpython/CPython.jl +++ b/src/cpython/CPython.jl @@ -18,6 +18,8 @@ include("gil.jl") include("jlwrap.jl") function __init__() + ccall(:jl_generating_output, Cint, ()) == 1 && return nothing + init_context() with_gil() do init_jlwrap()