Skip to content
This repository was archived by the owner on Oct 29, 2019. It is now read-only.

Commit 7761256

Browse files
committed
fixed get_ip again
1 parent fe226a7 commit 7761256

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

network/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def get_ip(ifname):
1313
return socket.inet_ntoa(fcntl.ioctl(
1414
s.fileno(),
1515
0x8915, # SIOCGIFADDR
16-
struct.pack('256s', ifname[:15])
16+
struct.pack('256s', bytes(ifname[:15], 'utf-8'))
1717
)[20:24])

0 commit comments

Comments
 (0)