Browse Source

Prevent crash when 'localhost' does not resolve in all_localhosts().

pull/7/merge
ShyPike 14 years ago
parent
commit
753ed1c846
  1. 7
      SABnzbd.py

7
SABnzbd.py

@ -495,7 +495,12 @@ def print_modules():
def all_localhosts():
""" Return all unique values of localhost """
ips = []
for item in socket.getaddrinfo('localhost', None):
try:
info = socket.getaddrinfo('localhost', None)
except:
# localhost does not resolve
return ['127.0.0.1']
for item in info:
item = item[4][0]
if item not in ips:
ips.append(item)

Loading…
Cancel
Save