Show More
@@ -64,7 +64,9 b' def getip():' | |||||
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' |
General Comments 0
You need to be logged in to leave comments.
Login now