mirror of https://github.com/python/cpython
Remove use of deprecated `array.fromstring` method (GH-17332)
This commit is contained in:
parent
6dd9b64770
commit
386d00cc34
|
@ -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.
|
||||
|
|
|
@ -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})"
|
||||
|
|
|
Loading…
Reference in New Issue