Skip to content

Commit 3e13f91

Browse files
committed
gh-145030: Address review: rename carve-out and assert st_nlink
Rename is_named_fifo_on_macos to is_named_fifo_on_apple to match the Apple platform set, and assert st_nlink != 0 in the named FIFO test.
1 parent 094c1d4 commit 3e13f91

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/asyncio/unix_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,12 @@ def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
665665
# ever report a false disconnection (gh-145030). The same xnu
666666
# behaviour applies on iOS/tvOS/watchOS (sys.platform is not
667667
# "darwin" there).
668-
is_named_fifo_on_macos = (
668+
is_named_fifo_on_apple = (
669669
sys.platform in {"darwin", "ios", "tvos", "watchos"}
670670
and is_fifo and pipe_stat.st_nlink > 0)
671671
if is_socket or (is_fifo
672672
and not sys.platform.startswith("aix")
673-
and not is_named_fifo_on_macos):
673+
and not is_named_fifo_on_apple):
674674
# only start reading when connection_made() has been called
675675
self._loop.call_soon(self._loop._add_reader,
676676
self._fileno, self._read_ready)

Lib/test/test_asyncio/test_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,7 @@ def test_write_named_fifo_unread_data(self):
17351735
# and close itself.
17361736
path = os_helper.TESTFN
17371737
os.mkfifo(path)
1738+
self.assertNotEqual(os.stat(path).st_nlink, 0)
17381739
self.addCleanup(os_helper.unlink, path)
17391740
rfd = os.open(path, os.O_RDONLY | os.O_NONBLOCK)
17401741
self.addCleanup(os.close, rfd)

0 commit comments

Comments
 (0)