Skip to content

Commit 862fd89

Browse files
authored
gh-109981: Resolve situation on iOS regarding fd_count. (#132823)
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.
1 parent b5bf8c8 commit 862fd89

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/test/support/os_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def fd_count():
657657
"""
658658
if sys.platform.startswith(('linux', 'android', 'freebsd', 'emscripten')):
659659
fd_path = "/proc/self/fd"
660-
elif sys.platform == "darwin":
660+
elif support.is_apple:
661661
fd_path = "/dev/fd"
662662
else:
663663
fd_path = None
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)