Skip to content

Commit 33bac43

Browse files
committed
Extract independent Python 3.15 library updates from the integration PR
Sync four files via scripts/update_lib migrate from CPython v3.15.0. Restore low-level interpreter/channel tests, asyncio eager-task coverage, and the iOS Objective-C loader fallback. Assisted-by: Codex:version-unavailable
1 parent cc6fb57 commit 33bac43

4 files changed

Lines changed: 3013 additions & 5 deletions

File tree

‎Lib/_ios_support.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
else:
1111
# ctypes is available. Load the ObjC library, and wrap the objc_getClass,
1212
# sel_registerName methods
13-
lib = util.find_library("objc")
14-
if lib is None:
15-
# Failed to load the objc library
16-
raise ImportError("ObjC runtime library couldn't be loaded")
13+
# find_library() resolves a system library through the dyld shared cache,
14+
# which needs _dyld_shared_cache_contains_path(); that is unavailable before
15+
# iOS 14, so fall back to the bare name, which dyld resolves by itself.
16+
lib = util.find_library("objc") or "libobjc.dylib"
1717

18-
objc = cdll.LoadLibrary(lib)
18+
try:
19+
objc = cdll.LoadLibrary(lib)
20+
except OSError:
21+
raise ImportError("ObjC runtime library couldn't be loaded")
1922
objc.objc_getClass.restype = c_void_p
2023
objc.objc_getClass.argtypes = [c_char_p]
2124
objc.sel_registerName.restype = c_void_p

0 commit comments

Comments
 (0)