Skip to content

Commit dadff6f

Browse files
Remove use of deprecated array.fromstring method (GH-17332)
(cherry picked from commit 386d00c) Co-authored-by: David Coles <[email protected]>
1 parent 089387e commit dadff6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/socket.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,9 +1394,9 @@ to sockets.
13941394
fds = array.array("i") # Array of ints
13951395
msg, ancdata, flags, addr = sock.recvmsg(msglen, socket.CMSG_LEN(maxfds * fds.itemsize))
13961396
for cmsg_level, cmsg_type, cmsg_data in ancdata:
1397-
if (cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS):
1397+
if cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS:
13981398
# Append data, ignoring any truncated integers at the end.
1399-
fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
1399+
fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
14001400
return msg, list(fds)
14011401

14021402
.. availability:: most Unix platforms, possibly others.

Doc/tools/susp-ignored.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ library/readline,,:bind,"python:bind ^I rl_complete"
199199
library/smtplib,,:port,method must support that as well as a regular host:port
200200
library/socket,,::,'5aef:2b::8'
201201
library/socket,,:can,"return (can_id, can_dlc, data[:can_dlc])"
202-
library/socket,,:len,fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
202+
library/socket,,:len,fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
203203
library/sqlite3,,:age,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
204204
library/sqlite3,,:memory,
205205
library/sqlite3,,:who,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"

0 commit comments

Comments
 (0)