1. Armin Rigo
  2. cpython-withatomic

Commits

Ka-Ping Yee  committed af810f0

Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'.

  • Participants
  • Parent commits a015aed
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/pydoc.py

View file
  • Ignore whitespace
 
     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)