@@ -17,7 +17,6 @@ A handle to a loaded instance of libpython, its interpreter, function pointers,
1717 pyhome_w:: Any = missing
1818 which:: Symbol = :unknown # :CondaPkg, :PyCall, :embedded or :unknown
1919 version:: Union{VersionNumber,Missing} = missing
20- matches_pycall:: Union{Bool,Missing} = missing
2120end
2221
2322const CTX = Context ()
@@ -141,15 +140,9 @@ function init_context()
141140 # Get function pointers from the library
142141 init_pointers ()
143142
144- # Compare libpath with PyCall
145- @require PyCall = " 438e738f-606a-5dbb-bf0a-cddfbfd45ab0" init_pycall (PyCall)
146-
147143 # Initialize the interpreter
148144 CTX. is_preinitialized = Py_IsInitialized () != 0
149- if CTX. is_preinitialized
150- @assert CTX. which == :PyCall || CTX. matches_pycall isa Bool
151- else
152- @assert CTX. which != :PyCall
145+ if ! CTX. is_preinitialized
153146 # Find ProgramName and PythonHome
154147 script = if Sys. iswindows ()
155148 """
@@ -243,13 +236,3 @@ const PYTHONCALL_PKGID = Base.PkgId(PYTHONCALL_UUID, "PythonCall")
243236
244237const PYCALL_UUID = Base. UUID (" 438e738f-606a-5dbb-bf0a-cddfbfd45ab0" )
245238const PYCALL_PKGID = Base. PkgId (PYCALL_UUID, " PyCall" )
246-
247- function init_pycall (PyCall:: Module )
248- # see if PyCall and PythonCall are using the same interpreter by checking if a couple of memory addresses are the same
249- ptr1 = Py_GetVersion ()
250- ptr2 = @eval PyCall ccall (@pysym (:Py_GetVersion ), Ptr{Cchar}, ())
251- CTX. matches_pycall = ptr1 == ptr2
252- if CTX. which == :PyCall
253- @assert CTX. matches_pycall
254- end
255- end
0 commit comments