diff options
author | Ka-Ping Yee <ping@zesty.ca> | 2001-03-02 05:58:17 +0000 |
---|---|---|
committer | Ka-Ping Yee <ping@zesty.ca> | 2001-03-02 05:58:17 +0000 |
commit | cc96406ac901e24e52bad068e02f7197a0bf9c84 (patch) | |
tree | c030f68eff1ad1f183950e4b2ffaa90bfd709e2b /Lib/pydoc.py | |
parent | 1d318b030944e3e2e45cabf8cc0ee2b04a828582 (diff) | |
download | cpython-cc96406ac901e24e52bad068e02f7197a0bf9c84.tar.gz |
Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 2eef833d33..607458b1db 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1142,8 +1142,9 @@ pydoc</strong> by Ka-Ping Yee <ping@lfw.org></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) |