Fix array.array object has no attribute tostring()

array.tostring() was renamed to array.tobytes() for clarity in python 3.2 and further removed in python 3.9
This commit is contained in:
ANISH M 2023-02-26 22:04:32 +05:30 committed by GitHub
parent 7cd1bcbccd
commit 111f923a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,7 @@ def all_interfaces():
max_possible *= 2
else:
break
namestr = names.tostring()
namestr = names.tobytes()
return [(namestr[i:i+16].split(b'\0', 1)[0],
socket.inet_ntoa(namestr[i+20:i+24]))
for i in range(0, outbytes, struct_size)]