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.
"""
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
--- /dev/null
+The test helper that counts the list of open file descriptors now uses the\r
+optimised ``/dev/fd`` approach on all Apple platforms, not just macOS.\r
+This avoids crashes caused by guarded file descriptors.\r