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 @@ -6492,13 +6492,6 @@ def test_dualstack_ipv6_family(self):
6492
6492
class CreateServerFunctionalTest (unittest .TestCase ):
6493
6493
timeout = support .LOOPBACK_TIMEOUT
6494
6494
6495
- def setUp (self ):
6496
- self .thread = None
6497
-
6498
- def tearDown (self ):
6499
- if self .thread is not None :
6500
- self .thread .join (self .timeout )
6501
-
6502
6495
def echo_server (self , sock ):
6503
6496
def run (sock ):
6504
6497
with sock :
@@ -6512,8 +6505,9 @@ def run(sock):
6512
6505
6513
6506
event = threading .Event ()
6514
6507
sock .settimeout (self .timeout )
6515
- self .thread = threading .Thread (target = run , args = (sock , ))
6516
- self .thread .start ()
6508
+ thread = threading .Thread (target = run , args = (sock , ))
6509
+ thread .start ()
6510
+ self .addCleanup (thread .join , self .timeout )
6517
6511
event .set ()
6518
6512
6519
6513
def echo_client (self , addr , family ):
You can’t perform that action at this time.
0 commit comments