Skip to content

Commit e13180b

Browse files
bpo-34130: Fix test_signal.test_socket() (GH-8326) (GH-8330)
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. (cherry picked from commit 99bb6df) Co-authored-by: Victor Stinner <[email protected]>
1 parent c774f76 commit e13180b

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
@@ -370,7 +370,6 @@ def handler(signum, frame):
370370
signal.signal(signum, handler)
371371
372372
read, write = socket.socketpair()
373-
read.setblocking(False)
374373
write.setblocking(False)
375374
signal.set_wakeup_fd(write.fileno())
376375

0 commit comments

Comments
 (0)