Skip to content

Commit 99bb6df

Browse files
authored
bpo-34130: Fix test_signal.test_socket() (GH-8326)
test_signal.test_socket(): On Windows, sometimes even if the C signal handler succeed to write the signal number into the write end of the socketpair, the test fails with a BlockingIOError on the non-blocking read.recv(1) because the read end of the socketpair didn't receive the byte yet. Fix the race condition on Windows by setting the read end as blocking.
1 parent 5d4cb54 commit 99bb6df

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Lib/test/test_signal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ def handler(signum, frame):
392392
signal.signal(signum, handler)
393393
394394
read, write = socket.socketpair()
395-
read.setblocking(False)
396395
write.setblocking(False)
397396
signal.set_wakeup_fd(write.fileno())
398397

0 commit comments

Comments
 (0)