Mercurial > public > mercurial-scm > hg
diff hgext/zeroconf/__init__.py @ 10317:192083a3e6fe stable
zeroconf: gethostbyaddr may also fail with socket.herror
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 05 Feb 2010 10:16:52 -0600 |
parents | 25e572394f5c |
children | 579aae5aa549 |
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py Fri Feb 05 04:33:08 2010 -0600 +++ b/hgext/zeroconf/__init__.py Fri Feb 05 10:16:52 2010 -0600 @@ -49,7 +49,7 @@ dumbip = socket.gethostbyaddr(socket.gethostname())[2][0] if not dumbip.startswith('127.') and ':' not in dumbip: return dumbip - except socket.gaierror: + except (socket.gaierror, socket.herror): dumbip = '127.0.0.1' # works elsewhere, but actually sends a packet