We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f1219f commit c4f2ad7Copy full SHA for c4f2ad7
pythonnet/find_libpython/__init__.py
@@ -77,6 +77,9 @@ class Dl_info(ctypes.Structure):
77
78
79
def _linked_libpython_unix():
80
+ if not sysconfig.get_config_var("Py_ENABLE_SHARED"):
81
+ return None
82
+
83
libdl = ctypes.CDLL(ctypes.util.find_library("dl"))
84
libdl.dladdr.argtypes = [ctypes.c_void_p, ctypes.POINTER(Dl_info)]
85
libdl.dladdr.restype = ctypes.c_int
@@ -88,8 +91,6 @@ def _linked_libpython_unix():
88
91
if retcode == 0: # means error
89
92
return None
90
93
path = os.path.realpath(dlinfo.dli_fname.decode())
- if path == os.path.realpath(sys.executable):
- return None
94
return path
95
96
0 commit comments