summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2013-03-03 21:48:15 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2013-03-03 21:48:15 (GMT)
commit6386e17f392d984fa5d16df4c6c74314aecbb588 (patch)
tree7f2de19d64894f72e0e2ce6d8111895182bae1a9 /Lib
parentb394c1dac8eaf398ed245c7599474b6c4213d03f (diff)
parentad246bfb712f04b34e993b0e70e470f6d759e736 (diff)
downloadcpython-6386e17f392d984fa5d16df4c6c74314aecbb588.zip
cpython-6386e17f392d984fa5d16df4c6c74314aecbb588.tar.gz
cpython-6386e17f392d984fa5d16df4c6c74314aecbb588.tar.bz2
Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 32b6131..8735832 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -979,7 +979,11 @@ else:
self.sslconn = self.server.context.wrap_socket(
self.sock, server_side=True)
self.server.selected_protocols.append(self.sslconn.selected_npn_protocol())
- except ssl.SSLError as e:
+ except (ssl.SSLError, ConnectionResetError) as e:
+ # We treat ConnectionResetError as though it were an
+ # SSLError - OpenSSL on Ubuntu abruptly closes the
+ # connection when asked to use an unsupported protocol.
+ #
# XXX Various errors can have happened here, for example
# a mismatching protocol version, an invalid certificate,
# or a low-level bug. This should be made more discriminating.