summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/ssl_servers.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index a0b77b5..914a943 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -2,6 +2,7 @@ import os
import sys
import ssl
import pprint
+import socket
import threading
import urllib.parse
# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
@@ -31,8 +32,14 @@ class HTTPSServer(_HTTPServer):
def get_request(self):
# override this to wrap socket with SSL
- sock, addr = self.socket.accept()
- sslconn = self.context.wrap_socket(sock, server_side=True)
+ try:
+ sock, addr = self.socket.accept()
+ sslconn = self.context.wrap_socket(sock, server_side=True)
+ except socket.error as e:
+ # socket errors are silenced by the caller, print them here
+ if support.verbose:
+ sys.stderr.write("Got an error:\n%s\n" % e)
+ raise
return sslconn, addr
class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):