hgext/zeroconf/__init__.py
changeset 7777 e3425726b80d
parent 7606 e86ca711544d
child 7845 c2cd8d772805
equal deleted inserted replaced
7776:34ff1a1b5dd7 7777:e3425726b80d
    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)