Skip to content

Commit bf67bd8

Browse files
Fix doc strings
1 parent 0f03c42 commit bf67bd8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Doc/library/socket.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,7 @@ to sockets.
15671567
.. method:: socket.send_fds(sock, buffers, fds[, flags[, address]])
15681568

15691569
Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket.
1570+
The *fds* parameter is a sequence of file descriptors.
15701571
Consult :meth:`sendmsg` for the documentation of these parameters.
15711572

15721573
.. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism.
@@ -1578,7 +1579,7 @@ to sockets.
15781579
Receive up to *maxfds* file descriptors. Return ``(msg, list(fds), flags, addr)``. Consult
15791580
:meth:`recvmsg` for the documentation of these parameters.
15801581

1581-
.. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism.
1582+
.. availability:: Unix supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` mechanism.
15821583

15831584
.. versionadded:: 3.9
15841585

Lib/socket.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def fromfd(fd, family, type, proto=0):
469469
import array
470470

471471
def send_fds(sock, buffers, fds, flags=0, address=None):
472-
""" send_fds(sock, buffers, fds[, flags[, address]]) -> socket object
472+
""" send_fds(sock, buffers, fds[, flags[, address]]) -> integer
473473
474474
Send the list of file descriptors fds over an AF_UNIX socket.
475475
"""
@@ -481,9 +481,10 @@ def send_fds(sock, buffers, fds, flags=0, address=None):
481481
import array
482482

483483
def recv_fds(sock, bufsize, maxfds, flags=0):
484-
""" recv_fds(sock, bufsize, maxfds[, flags]) -> (socket object, socket object)
484+
""" recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file
485+
descriptors, msg_flags, address)
485486
486-
receive up to maxfds file descriptors returning the message
487+
Receive up to maxfds file descriptors returning the message
487488
data and a list containing the descriptors.
488489
"""
489490
# Array of ints

Lib/test/test_socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6279,7 +6279,7 @@ def close_fds(fds):
62796279
with sock1, sock2:
62806280
socket.send_fds(sock1, [MSG], fds)
62816281
# request more data and file descriptors than expected
6282-
msg, fds2, flags, addr = socket.recv_fds(sock2, len(MSG) * 2, len(fds) * 2)
6282+
msg, fds2, flags, addr = socket.recv_fds(sock2, len(MSG) * 2, len(fds) * 2)
62836283
self.addCleanup(close_fds, fds2)
62846284

62856285
self.assertEqual(msg, MSG)

0 commit comments

Comments
 (0)