]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'.
authorKa-Ping Yee <ping@zesty.ca>
Fri, 2 Mar 2001 05:58:17 +0000 (05:58 +0000)
committerKa-Ping Yee <ping@zesty.ca>
Fri, 2 Mar 2001 05:58:17 +0000 (05:58 +0000)
Lib/pydoc.py

index 2eef833d336f16073765708dde337340bbd9ad2a..607458b1dbe1bb517ea8bd7a832287cd9b984c56 100755 (executable)
@@ -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)