зеркало из https://github.com/mozilla/pjs.git
Bug 714903 - Fix getLanIp to work with Mac OS X as well instead of dying with an exception. r=jmaher
This commit is contained in:
Родитель
acc8960f93
Коммит
4cf5ad3f3e
|
@ -500,7 +500,10 @@ class NetworkTools:
|
|||
return None
|
||||
|
||||
def getLanIp(self):
|
||||
try:
|
||||
ip = socket.gethostbyname(socket.gethostname())
|
||||
except socket.gaierror:
|
||||
ip = socket.gethostbyname(socket.gethostname() + ".local") # for Mac OS X
|
||||
if ip.startswith("127.") and os.name != "nt":
|
||||
interfaces = ["eth0","eth1","eth2","wlan0","wlan1","wifi0","ath0","ath1","ppp0"]
|
||||
for ifname in interfaces:
|
||||
|
|
Загрузка…
Ссылка в новой задаче