mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-110391: socket NetworkConnectionAttributesTest always declare cli (#110401)
NetworkConnectionAttributesTest of test_socket now always declare the 'cli' attribute, so clientTearDown() cannot fail with AttributeError.
This commit is contained in:
		
							parent
							
								
									6e97a9647a
								
							
						
					
					
						commit
						e37d4557c3
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -5356,6 +5356,7 @@ def test_create_connection_timeout(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
 | 
					class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
 | 
				
			||||||
 | 
					    cli = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, methodName='runTest'):
 | 
					    def __init__(self, methodName='runTest'):
 | 
				
			||||||
        SocketTCPTest.__init__(self, methodName=methodName)
 | 
					        SocketTCPTest.__init__(self, methodName=methodName)
 | 
				
			||||||
| 
						 | 
					@ -5365,6 +5366,7 @@ def clientSetUp(self):
 | 
				
			||||||
        self.source_port = socket_helper.find_unused_port()
 | 
					        self.source_port = socket_helper.find_unused_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def clientTearDown(self):
 | 
					    def clientTearDown(self):
 | 
				
			||||||
 | 
					        if self.cli is not None:
 | 
				
			||||||
            self.cli.close()
 | 
					            self.cli.close()
 | 
				
			||||||
        self.cli = None
 | 
					        self.cli = None
 | 
				
			||||||
        ThreadableTest.clientTearDown(self)
 | 
					        ThreadableTest.clientTearDown(self)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue