summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2013-03-03 21:44:22 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2013-03-03 21:44:22 (GMT)
commitad246bfb712f04b34e993b0e70e470f6d759e736 (patch)
tree7fadb1e1003253bb4bddac6a9eb3c949af8422c0 /Lib/test
parent255bf5b9ec2d25698240cc1bf760887cd3c28436 (diff)
parent7b39b9b51baf3bc421917083f2b0451c841728bc (diff)
downloadcpython-ad246bfb712f04b34e993b0e70e470f6d759e736.zip
cpython-ad246bfb712f04b34e993b0e70e470f6d759e736.tar.gz
cpython-ad246bfb712f04b34e993b0e70e470f6d759e736.tar.bz2
Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.
Diffstat (limited to 'Lib/test')
-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 4bf7ad8..815475e 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -942,7 +942,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.