equal
deleted
inserted
replaced
50 except: |
50 except: |
51 pass |
51 pass |
52 |
52 |
53 # Generic method, sometimes gives useless results |
53 # Generic method, sometimes gives useless results |
54 dumbip = socket.gethostbyaddr(socket.gethostname())[2][0] |
54 dumbip = socket.gethostbyaddr(socket.gethostname())[2][0] |
55 if not dumbip.startswith('127.'): |
55 if not dumbip.startswith('127.') and ':' not in dumbip: |
56 return dumbip |
56 return dumbip |
57 |
57 |
58 # works elsewhere, but actually sends a packet |
58 # works elsewhere, but actually sends a packet |
59 try: |
59 try: |
60 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
60 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |