summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-14 14:43:44 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-14 14:43:44 (GMT)
commita468adc76d7e946b073579b783b246eb5e53850e (patch)
tree115cf23843f4e19f52aa8b611ed42817571649a3 /Lib/ssl.py
parent9bfc0f098474c841a40d27b9aa0be2fd085a6a53 (diff)
downloadcpython-a468adc76d7e946b073579b783b246eb5e53850e.zip
cpython-a468adc76d7e946b073579b783b246eb5e53850e.tar.gz
cpython-a468adc76d7e946b073579b783b246eb5e53850e.tar.bz2
Issue #9853: Fix the signature of SSLSocket.recvfrom() and
SSLSocket.sendto() to match the corresponding socket methods.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 0c609be..d5e4874 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -258,13 +258,15 @@ class SSLSocket(socket):
else:
return socket.send(self, data, flags)
- def sendto(self, data, addr, flags=0):
+ def sendto(self, data, flags_or_addr, addr=None):
self._checkClosed()
if self._sslobj:
raise ValueError("sendto not allowed on instances of %s" %
self.__class__)
+ elif addr is None:
+ return socket.sendto(self, data, flags_or_addr)
else:
- return socket.sendto(self, data, addr, flags)
+ return socket.sendto(self, data, flags_or_addr, addr)
def sendall(self, data, flags=0):
self._checkClosed()
@@ -308,13 +310,13 @@ class SSLSocket(socket):
else:
return socket.recv_into(self, buffer, nbytes, flags)
- def recvfrom(self, addr, buflen=1024, flags=0):
+ def recvfrom(self, buflen=1024, flags=0):
self._checkClosed()
if self._sslobj:
raise ValueError("recvfrom not allowed on instances of %s" %
self.__class__)
else:
- return socket.recvfrom(self, addr, buflen, flags)
+ return socket.recvfrom(self, buflen, flags)
def recvfrom_into(self, buffer, nbytes=None, flags=0):
self._checkClosed()