diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 14:47:08 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 14:47:08 (GMT) |
commit | 5974cdd5f598423002709d912276963c2032c69a (patch) | |
tree | 6194b100caec2d1cbcb93b5097e1626079d42b8c /Lib/ssl.py | |
parent | 3a883214ee3e7d79b14dcd42720d8efe55c147ad (diff) | |
download | cpython-5974cdd5f598423002709d912276963c2032c69a.zip cpython-5974cdd5f598423002709d912276963c2032c69a.tar.gz cpython-5974cdd5f598423002709d912276963c2032c69a.tar.bz2 |
Merged revisions 84807 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84807 | antoine.pitrou | 2010-09-14 16:43:44 +0200 (mar., 14 sept. 2010) | 4 lines
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.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -221,13 +221,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() @@ -267,13 +269,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() |