| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,6 @@ def load(): | |||
| 29 | 29 | if _LOADED: | |
| 30 | 30 | return | |
| 31 | 31 | ||
| 32 | - from .find_libpython import linked_libpython | ||
| 33 | 32 | from os.path import join, dirname | |
| 34 | 33 | ||
| 35 | 34 | if _RUNTIME is None: | |
@@ -38,21 +37,11 @@ def load(): | |||
| 38 | 37 | set_default_runtime() | |
| 39 | 38 | ||
| 40 | 39 | dll_path = join(dirname(__file__), "runtime", "Python.Runtime.dll") | |
| 41 | - libpython = linked_libpython() | ||
| 42 | - | ||
| 43 | - if libpython and _FFI is None and sys.platform != "win32": | ||
| 44 | - # Load and leak libpython handle s.t. the .NET runtime doesn't dlcloses | ||
| 45 | - # it | ||
| 46 | - import posix | ||
| 47 | - | ||
| 48 | - import cffi | ||
| 49 | - _FFI = cffi.FFI() | ||
| 50 | - _FFI.dlopen(libpython, posix.RTLD_NODELETE | posix.RTLD_LOCAL) | ||
| 51 | - | ||
| 40 | + | ||
| 52 | 41 | _LOADER_ASSEMBLY = _RUNTIME.get_assembly(dll_path) | |
| 53 | 42 | ||
| 54 | 43 | func = _LOADER_ASSEMBLY["Python.Runtime.Loader.Initialize"] | |
| 55 | - if func(f"{libpython or ''}".encode("utf8")) != 0: | ||
| 44 | + if func(''.encode("utf8")) != 0: | ||
| 56 | 45 | raise RuntimeError("Failed to initialize Python.Runtime.dll") | |
| 57 | 46 | ||
| 58 | 47 | import atexit | |
| Back | FazBrowse Home | New Git URL |
0 commit comments