File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2323const CTX = Context ()
2424
2525function _atpyexit ()
26- if CTX. is_initialized && CTX. which != :PyCall
26+ if CTX. is_initialized && ! CTX. is_preinitialized
2727 @warn " Python exited unexpectedly"
2828 end
2929 CTX. is_initialized = false
@@ -40,7 +40,7 @@ function init_context()
4040 init_pointers ()
4141 # Check Python is initialized
4242 Py_IsInitialized () == 0 && error (" Python is not already initialized." )
43- CTX. is_initialized = CTX . is_preinitialized = true
43+ CTX. is_initialized = true
4444 CTX. which = :embedded
4545 exe_path = get (ENV , " JULIA_PYTHONCALL_EXE" , " " )
4646 if exe_path != " "
@@ -121,7 +121,8 @@ function init_context()
121121
122122 # Initialize
123123 with_gil () do
124- if Py_IsInitialized () != 0
124+ CTX. is_preinitialized = Py_IsInitialized () != 0
125+ if CTX. is_preinitialized
125126 # Already initialized (maybe you're using PyCall as well)
126127 @assert CTX. which in (:embedded , :PyCall )
127128 else
You can’t perform that action at this time.
0 commit comments