Skip to content

Commit 8df3fe3

Browse files
Apply ruff/Pylint rule PLR5501
PLR5501 Use `elif` instead of `else` then `if`, to reduce indentation
1 parent ed05f94 commit 8df3fe3

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/test_tcp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,11 +1616,10 @@ def test_ssl_connect_accepted_socket(self):
16161616
if hasattr(ssl, 'PROTOCOL_TLS_SERVER'):
16171617
server_proto = ssl.PROTOCOL_TLS_SERVER
16181618
client_proto = ssl.PROTOCOL_TLS_CLIENT
1619+
elif hasattr(ssl, 'PROTOCOL_TLS'):
1620+
client_proto = server_proto = ssl.PROTOCOL_TLS
16191621
else:
1620-
if hasattr(ssl, 'PROTOCOL_TLS'):
1621-
client_proto = server_proto = ssl.PROTOCOL_TLS
1622-
else:
1623-
client_proto = server_proto = ssl.PROTOCOL_SSLv23
1622+
client_proto = server_proto = ssl.PROTOCOL_SSLv23
16241623

16251624
server_context = ssl.SSLContext(server_proto)
16261625
server_context.load_cert_chain(self.ONLYCERT, self.ONLYKEY)

0 commit comments

Comments
 (0)