@@ -17,7 +17,6 @@ A handle to a loaded instance of libpython, its interpreter, function pointers,
17
17
pyhome_w:: Any = missing
18
18
which:: Symbol = :unknown # :CondaPkg, :PyCall, :embedded or :unknown
19
19
version:: Union{VersionNumber,Missing} = missing
20
- matches_pycall:: Union{Bool,Missing} = missing
21
20
end
22
21
23
22
const CTX = Context ()
@@ -141,15 +140,9 @@ function init_context()
141
140
# Get function pointers from the library
142
141
init_pointers ()
143
142
144
- # Compare libpath with PyCall
145
- @require PyCall = " 438e738f-606a-5dbb-bf0a-cddfbfd45ab0" init_pycall (PyCall)
146
-
147
143
# Initialize the interpreter
148
144
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
153
146
# Find ProgramName and PythonHome
154
147
script = if Sys. iswindows ()
155
148
"""
@@ -243,13 +236,3 @@ const PYTHONCALL_PKGID = Base.PkgId(PYTHONCALL_UUID, "PythonCall")
243
236
244
237
const PYCALL_UUID = Base. UUID (" 438e738f-606a-5dbb-bf0a-cddfbfd45ab0" )
245
238
const 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