File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -6482,13 +6482,6 @@ def test_dualstack_ipv6_family(self):
6482
6482
class CreateServerFunctionalTest (unittest .TestCase ):
6483
6483
timeout = support .LOOPBACK_TIMEOUT
6484
6484
6485
- def setUp (self ):
6486
- self .thread = None
6487
-
6488
- def tearDown (self ):
6489
- if self .thread is not None :
6490
- self .thread .join (self .timeout )
6491
-
6492
6485
def echo_server (self , sock ):
6493
6486
def run (sock ):
6494
6487
with sock :
@@ -6502,8 +6495,9 @@ def run(sock):
6502
6495
6503
6496
event = threading .Event ()
6504
6497
sock .settimeout (self .timeout )
6505
- self .thread = threading .Thread (target = run , args = (sock , ))
6506
- self .thread .start ()
6498
+ thread = threading .Thread (target = run , args = (sock , ))
6499
+ thread .start ()
6500
+ self .addCleanup (thread .join , self .timeout )
6507
6501
event .set ()
6508
6502
6509
6503
def echo_client (self , addr , family ):
You can’t perform that action at this time.
0 commit comments