Trying to fix #8108. Will watch the buildbot(s).
This commit is contained in:
parent
36b9fbb803
commit
914bdbb495
|
@ -315,12 +315,21 @@ if ssl is not None:
|
|||
raise
|
||||
|
||||
def close(self):
|
||||
ssl_want_read_or_write = False
|
||||
try:
|
||||
if isinstance(self.socket, ssl.SSLSocket):
|
||||
if self.socket._sslobj is not None:
|
||||
self.socket.unwrap()
|
||||
try:
|
||||
self.socket.unwrap()
|
||||
except ssl.SSLError, err:
|
||||
if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
|
||||
ssl.SSL_ERROR_WANT_WRITE):
|
||||
ssl_want_read_or_write = True
|
||||
else:
|
||||
raise
|
||||
finally:
|
||||
super(SSLConnection, self).close()
|
||||
if not ssl_want_read_or_write:
|
||||
super(SSLConnection, self).close()
|
||||
|
||||
|
||||
class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
|
||||
|
|
Loading…
Reference in New Issue