Skip to content

Commit 4040091

Browse files
Apply ruff/Pylint rule PLR5501
PLR5501 Use `elif` instead of `else` then `if`, to reduce indentation
1 parent 42d34a1 commit 4040091

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/test_tcp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,11 +1621,10 @@ def test_ssl_connect_accepted_socket(self):
16211621
if hasattr(ssl, 'PROTOCOL_TLS_SERVER'):
16221622
server_proto = ssl.PROTOCOL_TLS_SERVER
16231623
client_proto = ssl.PROTOCOL_TLS_CLIENT
1624+
elif hasattr(ssl, 'PROTOCOL_TLS'):
1625+
client_proto = server_proto = ssl.PROTOCOL_TLS
16241626
else:
1625-
if hasattr(ssl, 'PROTOCOL_TLS'):
1626-
client_proto = server_proto = ssl.PROTOCOL_TLS
1627-
else:
1628-
client_proto = server_proto = ssl.PROTOCOL_SSLv23
1627+
client_proto = server_proto = ssl.PROTOCOL_SSLv23
16291628

16301629
server_context = ssl.SSLContext(server_proto)
16311630
server_context.load_cert_chain(self.ONLYCERT, self.ONLYKEY)

0 commit comments

Comments
 (0)