Skip to content

Commit e37d455

Browse files
authored
gh-110391: socket NetworkConnectionAttributesTest always declare cli (#110401)
NetworkConnectionAttributesTest of test_socket now always declare the 'cli' attribute, so clientTearDown() cannot fail with AttributeError.
1 parent 6e97a96 commit e37d455

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_socket.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5356,6 +5356,7 @@ def test_create_connection_timeout(self):
53565356

53575357

53585358
class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
5359+
cli = None
53595360

53605361
def __init__(self, methodName='runTest'):
53615362
SocketTCPTest.__init__(self, methodName=methodName)
@@ -5365,7 +5366,8 @@ def clientSetUp(self):
53655366
self.source_port = socket_helper.find_unused_port()
53665367

53675368
def clientTearDown(self):
5368-
self.cli.close()
5369+
if self.cli is not None:
5370+
self.cli.close()
53695371
self.cli = None
53705372
ThreadableTest.clientTearDown(self)
53715373

0 commit comments

Comments
 (0)