summaryrefslogtreecommitdiff
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index a976533918..b7f2cf46e1 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -1261,8 +1261,9 @@ class FileHandler(BaseHandler):
def get_names(self):
if FileHandler.names is None:
try:
- FileHandler.names = (socket.gethostbyname('localhost'),
- socket.gethostbyname(socket.gethostname()))
+ FileHandler.names = tuple(
+ socket.gethostbyname_ex('localhost')[2] +
+ socket.gethostbyname_ex(socket.gethostname())[2])
except socket.gaierror:
FileHandler.names = (socket.gethostbyname('localhost'),)
return FileHandler.names