@@ -4478,13 +4478,9 @@ def check_semaphore_tracker_death(self, signum, should_die):
4478
4478
os .kill (pid , signal .SIGKILL )
4479
4479
time .sleep (0.5 ) # give it time to die
4480
4480
old_stderr = sys .stderr
4481
- r , w = os .pipe ()
4482
- # Make the pipe non blocking to not hang indefinitely
4483
- if sys .platform != "win32" :
4484
- import fcntl
4485
- fcntl .fcntl (r , fcntl .F_SETFL ,
4486
- fcntl .fcntl (r , fcntl .F_GETFL ) | os .O_NONBLOCK )
4487
- sys .stderr = open (w , "bw" )
4481
+ testfn = test .support .TESTFN
4482
+ self .addCleanup (test .support .unlink , testfn )
4483
+ sys .stderr = open (testfn , "bw" )
4488
4484
try :
4489
4485
with warnings .catch_warnings (record = True ) as all_warn :
4490
4486
_semaphore_tracker .ensure_running ()
@@ -4494,7 +4490,7 @@ def check_semaphore_tracker_death(self, signum, should_die):
4494
4490
# information.
4495
4491
_semaphore_tracker ._send ("PING" , "" )
4496
4492
deadline = time .monotonic () + 5
4497
- with open (r , "rb" ) as pipe :
4493
+ with open (testfn , "rb" ) as pipe :
4498
4494
while True :
4499
4495
if time .monotonic () >= deadline :
4500
4496
raise TimeoutError ("Reading data "
0 commit comments