From: Antoine Pitrou Date: Wed, 24 Mar 2010 21:55:12 +0000 (+0000) Subject: Trying to fix #8108. Will watch the buildbot(s). X-Git-Tag: v2.7b1~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=914bdbb4954a633357c42e290386ec2162470148;p=python Trying to fix #8108. Will watch the buildbot(s). --- diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 182d5a7c74..4b73e0082a 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -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):