We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parents23527d1 +dff75d2 commit0775458Copy full SHA for 0775458
pythonnet/__init__.py
@@ -29,7 +29,6 @@ def load():
29
if_LOADED:
30
return
31
32
-from .find_libpythonimportlinked_libpython
33
fromos.pathimportjoin,dirname
34
35
if_RUNTIMEisNone:
@@ -38,21 +37,11 @@ def load():
38
37
set_default_runtime()
39
40
dll_path=join(dirname(__file__),"runtime","Python.Runtime.dll")
41
-libpython=linked_libpython()
42
-
43
-iflibpythonand_FFIisNoneandsys.platform!="win32":
44
-# Load and leak libpython handle s.t. the .NET runtime doesn't dlcloses
45
-# it
46
-importposix
47
48
-importcffi
49
-_FFI=cffi.FFI()
50
-_FFI.dlopen(libpython,posix.RTLD_NODELETE|posix.RTLD_LOCAL)
51
+
52
_LOADER_ASSEMBLY=_RUNTIME.get_assembly(dll_path)
53
54
func=_LOADER_ASSEMBLY["Python.Runtime.Loader.Initialize"]
55
-iffunc(f"{libpythonor''}".encode("utf8"))!=0:
+iffunc(''.encode("utf8"))!=0:
56
raiseRuntimeError("Failed to initialize Python.Runtime.dll")
57
58
importatexit