Commit 24f2513
committed
Fall back to loading the ObjC runtime by name
ctypes.util.find_library() resolves a system library through the dyld shared
cache, which requires _dyld_shared_cache_contains_path(). Modules/_ctypes/
callproc.c guards that symbol with __builtin_available(iOS 14.0), so on iOS 13 -
the oldest release CPython's iOS support targets - find_library() returns None
for any library that exists only in the cache, and importing _ios_support fails
outright rather than degrading.
dyld resolves a bare library name against the cache by itself, so use that when
find_library() comes up empty. A genuine load failure is still reported as
ImportError.1 parent e8158d1 commit 24f2513
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
0 commit comments