Skip to content

Commit

Permalink
Merge branch 'master' into protocol-expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
nocarryr committed Feb 24, 2017
2 parents aa87287 + ae6237b commit 553e586
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vidhubcontrol/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ def find_ip_addresses(iface_name=None, exclude_loopback=True):
else:
iface_names = netifaces.interfaces()
for iface_name in iface_names:
addrs = netifaces.ifaddresses(iface_name)[netifaces.AF_INET]
try:
addrs = netifaces.ifaddresses(iface_name)[netifaces.AF_INET]
except KeyError:
continue
for addr in addrs:
iface = ipaddress.IPv4Interface('/'.join([addr['addr'], addr['netmask']]))
if iface.is_loopback and exclude_loopback:
Expand Down

0 comments on commit 553e586

Please sign in to comment.