dont fail without ip
This commit is contained in:
parent
6169c36b62
commit
d22c08e97c
1 changed files with 1 additions and 0 deletions
|
@ -138,6 +138,7 @@ def get_interface():
|
||||||
return interface
|
return interface
|
||||||
|
|
||||||
def get_local_ipv4():
|
def get_local_ipv4():
|
||||||
|
ip = None
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
cmd = ['/sbin/route', '-n', 'get', 'default']
|
cmd = ['/sbin/route', '-n', 'get', 'default']
|
||||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in a new issue