summaryrefslogtreecommitdiff
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-04-29 10:03:28 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2014-04-29 10:03:28 +0200
commit1a88f7836fb1d0ba824b29eee5d96866d761e464 (patch)
tree3b5bad685c996a8d80deb5cb96edef4c7d06042e /Lib/ssl.py
parent714d289b64da890d621d25b085971abe448de9f1 (diff)
downloadcpython-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.py12
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)