mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
b5bf8c80a9
commit
862fd89036
2 changed files with 4 additions and 1 deletions
|
@ -657,7 +657,7 @@ def fd_count():
|
|||
"""
|
||||
if sys.platform.startswith(('linux', 'android', 'freebsd', 'emscripten')):
|
||||
fd_path = "/proc/self/fd"
|
||||
elif sys.platform == "darwin":
|
||||
elif support.is_apple:
|
||||
fd_path = "/dev/fd"
|
||||
else:
|
||||
fd_path = None
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
The test helper that counts the list of open file descriptors now uses the
|
||||
optimised ``/dev/fd`` approach on all Apple platforms, not just macOS.
|
||||
This avoids crashes caused by guarded file descriptors.
|
Loading…
Add table
Add a link
Reference in a new issue