equal
deleted
inserted
replaced
62 pass |
62 pass |
63 |
63 |
64 # Generic method, sometimes gives useless results |
64 # Generic method, sometimes gives useless results |
65 try: |
65 try: |
66 dumbip = socket.gethostbyaddr(socket.gethostname())[2][0] |
66 dumbip = socket.gethostbyaddr(socket.gethostname())[2][0] |
67 if not dumbip.startswith('127.') and ':' not in dumbip: |
67 if ':' in dumbip: |
|
68 dumbip = '127.0.0.1' |
|
69 if not dumbip.startswith('127.'): |
68 return dumbip |
70 return dumbip |
69 except (socket.gaierror, socket.herror): |
71 except (socket.gaierror, socket.herror): |
70 dumbip = '127.0.0.1' |
72 dumbip = '127.0.0.1' |
71 |
73 |
72 # works elsewhere, but actually sends a packet |
74 # works elsewhere, but actually sends a packet |