Issue13104 - Fix urllib.request.thishost() utility function.

This commit is contained in:
Senthil Kumaran 2011-10-06 00:32:02 +08:00
parent ad87fa6719
commit 1b7da519b0
2 changed files with 5 additions and 1 deletions

View file

@ -2116,7 +2116,7 @@ def thishost():
"""Return the IP addresses of the current host."""
global _thishost
if _thishost is None:
_thishost = tuple(socket.gethostbyname_ex(socket.gethostname()[2]))
_thishost = tuple(socket.gethostbyname_ex(socket.gethostname())[2])
return _thishost
_ftperrors = None