load_fds: use frombytes instead of fromstring

Python 3.2 renamed array.fromstring to array.frombytes, but kept
the former as an, now deprecated, alias. Use the canonical form
which indeed better describes what is going on.
This commit is contained in:
Christian Kellner 2019-10-27 10:29:48 +01:00 committed by Lars Karlitski
parent 27cf84edd5
commit 1c5b97afbc

View file

@ -21,7 +21,7 @@ def load_fds(sock, msglen):
for cmsg_level, cmsg_type, cmsg_data in ancdata:
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 json.loads(msg), list(fds), addr