summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 2eef833..607458b 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1142,8 +1142,9 @@ pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font></small></small>"""
class DocServer(BaseHTTPServer.HTTPServer):
def __init__(self, port, callback):
- self.address = ('127.0.0.1', port)
- self.url = 'http://127.0.0.1:%d/' % port
+ host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
+ self.address = (host, port)
+ self.url = 'http://%s:%d/' % (host, port)
self.callback = callback
self.base.__init__(self, self.address, self.handler)