diff options
author | Ka-Ping Yee <ping@zesty.ca> | 2001-03-02 05:58:17 (GMT) |
---|---|---|
committer | Ka-Ping Yee <ping@zesty.ca> | 2001-03-02 05:58:17 (GMT) |
commit | db8ed1517f1c9008d4fd09e73967ecb75eeb2b01 (patch) | |
tree | 10b82241b7a5e640cd732cfeaa802aabd656d737 /Lib/pydoc.py | |
parent | 228d80736c39e41a6b46dad211df0ba871b0c8f8 (diff) | |
download | cpython-db8ed1517f1c9008d4fd09e73967ecb75eeb2b01.zip cpython-db8ed1517f1c9008d4fd09e73967ecb75eeb2b01.tar.gz cpython-db8ed1517f1c9008d4fd09e73967ecb75eeb2b01.tar.bz2 |
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 2eef833..607458b 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) |