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

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions 28 Lib/ctypes/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,25 @@ def find_library(name):
elif os.name == "posix" and sys.platform == "darwin":
from ctypes.macholib.dyld import dyld_find as _dyld_find
def find_library(name):
possible = ['lib%s.dylib' % name,
'%s.dylib' % name,
'%s.framework/%s' % (name, name)]
for name in possible:
try:
return _dyld_find(name)
except ValueError:
continue
return None
from platform import mac_ver
macos_version = mac_ver()[0]
if macos_version == '10.16' or macos_version == '11.0':
# see https://bugs.python.org/issue41179
# macOS Big Sur no longer copies dynamic libraries
# TODO (@sumanthratna): we shouldn't change this logic
# https://github.com/python/cpython/blob/0a2ee77547c0e25f081cfb6507a1ab8fecbd683a/Lib/ctypes/macholib/dyld.py#L15-L29
# this probably requires a change to ctypes.macholib.dyld.dyld_find
pass
else:
possible = ['lib%s.dylib' % name,
'%s.dylib' % name,
'%s.framework/%s' % (name, name)]
for name in possible:
try:
return _dyld_find(name)
except ValueError:
continue
return None

elif sys.platform.startswith("aix"):
# AIX has two styles of storing shared libraries
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.