Skip to content

Commit b220c1c

Browse files
[3.13] gh-109981: Resolve situation on iOS regarding fd_count. (GH-132823) (#132824)
Modifies the test helper that counts the list of open file descriptors to use the optimised ``/dev/fd`` approach on all Apple platforms, not just macOS. This avoids crashes caused by guarded file descriptors. (cherry picked from commit 862fd89) Co-authored-by: John <[email protected]>
1 parent f8d4ca4 commit b220c1c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/test/support/os_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def fd_count():
630630
"""
631631
if sys.platform.startswith(('linux', 'android', 'freebsd', 'emscripten')):
632632
fd_path = "/proc/self/fd"
633-
elif sys.platform == "darwin":
633+
elif support.is_apple:
634634
fd_path = "/dev/fd"
635635
else:
636636
fd_path = None
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The test helper that counts the list of open file descriptors now uses the
2+
optimised ``/dev/fd`` approach on all Apple platforms, not just macOS.
3+
This avoids crashes caused by guarded file descriptors.

0 commit comments

Comments
 (0)