Skip to content

Commit 9e05bcf

Browse files
committed
explicitly type fcntl.ioctl function
addresses an update of Python Typeshed
1 parent 820afc7 commit 9e05bcf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libioc/helpers_ioctl.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def get_sockio_ioctl(nic_name: str, ioctl: SOCKIO_IOCTLS) -> bytes:
4141
"""Query a sockio ioctl for a given NIC."""
4242
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) as sock:
4343
ifconf = struct.pack('256s', nic_name.encode("UTF-8")[:15])
44-
return bytes(fcntl.ioctl(sock.fileno(), ioctl.value, ifconf))
44+
return bytes(fcntl.ioctl(
45+
sock.fileno(),
46+
int(ioctl.value),
47+
bytes(ifconf),
48+
True
49+
))
4550

4651

4752
def get_interface_ip4_address(nic_name: str) -> ipaddress.IPv4Address:

0 commit comments

Comments
 (0)