summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-03-24 21:55:12 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-03-24 21:55:12 (GMT)
commit914bdbb4954a633357c42e290386ec2162470148 (patch)
treea2baf9ea5da3177fb39a7c2bb53ee9e6fcdd9a74 /Lib
parent36b9fbb803659350f9e6182b85f5bf66ca2a72a8 (diff)
downloadcpython-914bdbb4954a633357c42e290386ec2162470148.zip
cpython-914bdbb4954a633357c42e290386ec2162470148.tar.gz
cpython-914bdbb4954a633357c42e290386ec2162470148.tar.bz2
Trying to fix #8108. Will watch the buildbot(s).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ftplib.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 182d5a7..4b73e00 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):