diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-29 10:03:28 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-04-29 10:03:28 +0200 |
commit | 1a88f7836fb1d0ba824b29eee5d96866d761e464 (patch) | |
tree | 3b5bad685c996a8d80deb5cb96edef4c7d06042e /Lib/ssl.py | |
parent | 714d289b64da890d621d25b085971abe448de9f1 (diff) | |
download | cpython-1a88f7836fb1d0ba824b29eee5d96866d761e464.tar.gz |
Issue #20951: SSLSocket.send() now raises either SSLWantReadError or SSLWantWriteError on a non-blocking socket if the operation would block. Previously, it would return 0.
Patch by Nikolaus Rath.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r-- | Lib/ssl.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py index 9c91096d1d..8f12513e8d 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -664,17 +664,7 @@ class SSLSocket(socket): raise ValueError( "non-zero flags not allowed in calls to send() on %s" % self.__class__) - try: - v = self._sslobj.write(data) - except SSLError as x: - if x.args[0] == SSL_ERROR_WANT_READ: - return 0 - elif x.args[0] == SSL_ERROR_WANT_WRITE: - return 0 - else: - raise - else: - return v + return self._sslobj.write(data) else: return socket.send(self, data, flags) |