Commit b7b4b087 authored by Sam Rushing's avatar Sam Rushing

various socket write functions need "except -1"

parent 2e46a084
......@@ -169,11 +169,11 @@ cdef public class sock [ object sock_object, type sock_type ]:
cpdef object recvfrom (self, int buffer_size, int flags=?)
cpdef bytes recv_exact (self, int bytes)
cpdef readv (self, list size_list)
cpdef int send (self, bytes data)
cpdef int sendto (self, bytes data, address, int flags=?)
cpdef int sendall (self, bytes data)
cpdef int write (self, bytes data)
cpdef int writev (self, list data)
cpdef int send (self, bytes data) except -1
cpdef int sendto (self, bytes data, address, int flags=?) except -1
cpdef int sendall (self, bytes data) except -1
cpdef int write (self, bytes data) except -1
cpdef int writev (self, list data) except -1
# XXX is there a cpython.type for buffer objects?
IF False:
cpdef recv_into (self, buffer, int nbytes=?, int flags=?)
......
......@@ -279,7 +279,7 @@ cdef public class sock [ object sock_object, type sock_type ]:
else:
raise_oserror()
cpdef int send (self, bytes data):
cpdef int send (self, bytes data) except -1:
"""Send data on the socket.
This will repeatedly call write to ensure all data has been sent. This
......@@ -319,21 +319,21 @@ cdef public class sock [ object sock_object, type sock_type ]:
if left == 0:
return sent
cpdef int sendall(self, bytes data):
cpdef int sendall(self, bytes data) except -1:
"""Send all data.
This is an alias for the :meth:`send` method.
"""
return self.send(data)
cpdef int write (self, bytes data):
cpdef int write (self, bytes data) except -1:
"""Write data.
This is an alias for the :meth:`send` method.
"""
return self.send(data)
cpdef int sendto (self, bytes data, address, int flags=0):
cpdef int sendto (self, bytes data, address, int flags=0) except -1:
"""Send data to a specific address.
:param data: The data to send.
......@@ -614,7 +614,7 @@ cdef public class sock [ object sock_object, type sock_type ]:
finally:
PyMem_Free(iov)
cpdef int writev (self, list data):
cpdef int writev (self, list data) except -1:
"""Write a vector array of data.
This will repeatedly call writev until all data is sent. If it is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment