File tree 1 file changed +3
-9
lines changed 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -6528,13 +6528,6 @@ def test_dualstack_ipv6_family(self):
6528
6528
class CreateServerFunctionalTest (unittest .TestCase ):
6529
6529
timeout = support .LOOPBACK_TIMEOUT
6530
6530
6531
- def setUp (self ):
6532
- self .thread = None
6533
-
6534
- def tearDown (self ):
6535
- if self .thread is not None :
6536
- self .thread .join (self .timeout )
6537
-
6538
6531
def echo_server (self , sock ):
6539
6532
def run (sock ):
6540
6533
with sock :
@@ -6548,8 +6541,9 @@ def run(sock):
6548
6541
6549
6542
event = threading .Event ()
6550
6543
sock .settimeout (self .timeout )
6551
- self .thread = threading .Thread (target = run , args = (sock , ))
6552
- self .thread .start ()
6544
+ thread = threading .Thread (target = run , args = (sock , ))
6545
+ thread .start ()
6546
+ self .addCleanup (thread .join , self .timeout )
6553
6547
event .set ()
6554
6548
6555
6549
def echo_client (self , addr , family ):
You can’t perform that action at this time.
0 commit comments