Skip to content

Commit

Permalink
pythongh-110467: update server exception handling of test_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
keepworking committed Feb 11, 2024
1 parent 4101d1a commit bd0cf4f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2397,20 +2397,19 @@ def run(self):
self.write(msg.lower())
except OSError as e:
# handles SSLError and socket errors
if self.server.chatty and support.verbose:
if isinstance(e, ConnectionError):
# OpenSSL 1.1.1 sometimes raises
# ConnectionResetError when connection is not
# shut down gracefully.
print(
f" Connection reset by peer: {self.addr}"
)
if isinstance(e, ConnectionError):
# OpenSSL 1.1.1 sometimes raises
# ConnectionResetError when connection is not
# shut down gracefully.
print(
f" Connection reset by peer: {self.addr}"
)

self.close()
self.running = False
return
else:
handle_error("Test server failure:\n")
self.close()
self.running = False
return
if self.server.chatty and support.verbose:
handle_error("Test server failure:\n")
try:
self.write(b"ERROR\n")
except OSError:
Expand Down

0 comments on commit bd0cf4f

Please sign in to comment.