Commit 7351b66e authored by Senthil Kumaran's avatar Senthil Kumaran

Fix thishost helper funtion in urllib. Returns the ipaddress of localhost when

hostname is resolvable by socket.gethostname for local machine. This all fixes
certain freebsd builtbot failures.
parent 243cb807
......@@ -819,7 +819,10 @@ def thishost():
"""Return the IP address of the current host."""
global _thishost
if _thishost is None:
_thishost = socket.gethostbyname(socket.gethostname())
try:
_thishost = socket.gethostbyname(socket.gethostname())
except socket.gaierror:
_thishost = socket.gethostbyname('localhost')
return _thishost
_ftperrors = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment