From 8ad6e50ac796af8ab7cdda79bed86ad956f1e2dd Mon Sep 17 00:00:00 2001 From: Ames <355547@win.lanl.gov> Date: Thu, 22 Jun 2023 10:53:20 -0600 Subject: [PATCH] Skip __init__ when precompiling --- src/PythonCall.jl | 2 ++ src/cpython/CPython.jl | 2 ++ 2 files changed, 4 insertions(+) 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()