Remove use of deprecated `array.fromstring` method (GH-17332)

This commit is contained in:
David Coles 2019-11-25 22:31:09 -08:00 committed by Inada Naoki
parent 6dd9b64770
commit 386d00cc34
2 changed files with 3 additions and 3 deletions

View File

@ -1411,9 +1411,9 @@ to sockets.
fds = array.array("i") # Array of ints
msg, ancdata, flags, addr = sock.recvmsg(msglen, socket.CMSG_LEN(maxfds * fds.itemsize))
for cmsg_level, cmsg_type, cmsg_data in ancdata:
if (cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS):
if cmsg_level == socket.SOL_SOCKET and cmsg_type == socket.SCM_RIGHTS:
# Append data, ignoring any truncated integers at the end.
fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
return msg, list(fds)
.. availability:: most Unix platforms, possibly others.

View File

@ -201,7 +201,7 @@ library/readline,,:bind,"python:bind ^I rl_complete"
library/smtplib,,:port,method must support that as well as a regular host:port
library/socket,,::,'5aef:2b::8'
library/socket,,:can,"return (can_id, can_dlc, data[:can_dlc])"
library/socket,,:len,fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
library/socket,,:len,fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
library/sqlite3,,:age,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
library/sqlite3,,:memory,
library/sqlite3,,:who,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"

1 c-api/arg :ref PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
201 library/smtplib :port method must support that as well as a regular host:port
202 library/socket :: '5aef:2b::8'
203 library/socket :can return (can_id, can_dlc, data[:can_dlc])
204 library/socket :len fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)]) fds.frombytes(cmsg_data[:len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
205 library/sqlite3 :age cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
206 library/sqlite3 :memory
207 library/sqlite3 :who cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})