diff --git a/pythonnet/__init__.py b/pythonnet/__init__.py index 692fd5700..188980b8b 100644 --- a/pythonnet/__init__.py +++ b/pythonnet/__init__.py @@ -29,7 +29,6 @@ def load(): if _LOADED: return - from .find_libpython import linked_libpython from os.path import join, dirname if _RUNTIME is None: @@ -38,21 +37,11 @@ def load(): set_default_runtime() dll_path = join(dirname(__file__), "runtime", "Python.Runtime.dll") - libpython = linked_libpython() - - if libpython and _FFI is None and sys.platform != "win32": - # Load and leak libpython handle s.t. the .NET runtime doesn't dlcloses - # it - import posix - - import cffi - _FFI = cffi.FFI() - _FFI.dlopen(libpython, posix.RTLD_NODELETE | posix.RTLD_LOCAL) - + _LOADER_ASSEMBLY = _RUNTIME.get_assembly(dll_path) func = _LOADER_ASSEMBLY["Python.Runtime.Loader.Initialize"] - if func(f"{libpython or ''}".encode("utf8")) != 0: + if func(''.encode("utf8")) != 0: raise RuntimeError("Failed to initialize Python.Runtime.dll") import atexit pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy