Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4f2ad7

Browse files
authored
Adjust static libpython detection (pythonnet#1396)
* Check for Py_ENABLE_SHARED on Unix
1 parent6f1219f commitc4f2ad7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎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+
ifnotsysconfig.get_config_var("Py_ENABLE_SHARED"):
81+
returnNone
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
ifretcode==0:# means error
8992
returnNone
9093
path=os.path.realpath(dlinfo.dli_fname.decode())
91-
ifpath==os.path.realpath(sys.executable):
92-
returnNone
9394
returnpath
9495

9596

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp