summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-04-29 08:03:28 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-04-29 08:03:28 (GMT)
commitb4bebdafe354f68a9b952772da109cccd73f6577 (patch)
tree939614adab3160c1c9d54ba6975b326a2cdd31b9 /Lib/ssl.py
parent727a463aa624931a89c796bfa4fe5711e2c403ff (diff)
downloadcpython-b4bebdafe354f68a9b952772da109cccd73f6577.zip
cpython-b4bebdafe354f68a9b952772da109cccd73f6577.tar.gz
cpython-b4bebdafe354f68a9b952772da109cccd73f6577.tar.bz2
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 9c91096..8f12513 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)