diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 14:41:48 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 14:41:48 (GMT) |
commit | 52093b8e57a8c4f4be1517208cb370512ff3469d (patch) | |
tree | 857c36ba48ad717bd4ec4bd356fc514a110744d6 /Lib | |
parent | 6557aac599f1c22051ee61ba61c8c43add406e94 (diff) | |
download | cpython-52093b8e57a8c4f4be1517208cb370512ff3469d.zip cpython-52093b8e57a8c4f4be1517208cb370512ff3469d.tar.gz cpython-52093b8e57a8c4f4be1517208cb370512ff3469d.tar.bz2 |
Fix an occasional test_ftplib failure, following r79226.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ftplib.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index e8241e8..182d5a7 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -293,7 +293,9 @@ if ssl is not None: try: return super(SSLConnection, self).send(data) except ssl.SSLError, err: - if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN): + if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN, + ssl.SSL_ERROR_WANT_READ, + ssl.SSL_ERROR_WANT_WRITE): return 0 raise @@ -301,6 +303,9 @@ if ssl is not None: try: return super(SSLConnection, self).recv(buffer_size) except ssl.SSLError, err: + if err.args[0] in (ssl.SSL_ERROR_WANT_READ, + ssl.SSL_ERROR_WANT_WRITE): + return '' if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN): self.handle_close() return '' |