gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401)
NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.
(cherry picked from commit
e37d4557c3de0476e76ca4b8a1cc8d2566b86c79)
Co-authored-by: Victor Stinner <vstinner@python.org>
class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
+ cli = None
def __init__(self, methodName='runTest'):
SocketTCPTest.__init__(self, methodName=methodName)
self.source_port = socket_helper.find_unused_port()
def clientTearDown(self):
- self.cli.close()
+ if self.cli is not None:
+ self.cli.close()
self.cli = None
ThreadableTest.clientTearDown(self)