Content-Length: 291058 | pFad | http://github.com/pythonnet/pythonnet/commit/c4f2ad77d2102515733762e248b8b296f5f3b509

00 Adjust static libpython detection (#1396) · pythonnet/pythonnet@c4f2ad7 · GitHub
Skip to content

Commit c4f2ad7

Browse files
authored
Adjust static libpython detection (#1396)
* Check for Py_ENABLE_SHARED on Unix
1 parent 6f1219f commit c4f2ad7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pythonnet/find_libpython/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class Dl_info(ctypes.Structure):
7777

7878

7979
def _linked_libpython_unix():
80+
if not sysconfig.get_config_var("Py_ENABLE_SHARED"):
81+
return None
82+
8083
libdl = ctypes.CDLL(ctypes.util.find_library("dl"))
8184
libdl.dladdr.argtypes = [ctypes.c_void_p, ctypes.POINTER(Dl_info)]
8285
libdl.dladdr.restype = ctypes.c_int
@@ -88,8 +91,6 @@ def _linked_libpython_unix():
8891
if retcode == 0: # means error
8992
return None
9093
path = os.path.realpath(dlinfo.dli_fname.decode())
91-
if path == os.path.realpath(sys.executable):
92-
return None
9394
return path
9495

9596

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/pythonnet/pythonnet/commit/c4f2ad77d2102515733762e248b8b296f5f3b509

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy