From: Ka-Ping Yee Date: Fri, 2 Mar 2001 05:58:17 +0000 (+0000) Subject: Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'. X-Git-Tag: v2.1b1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db8ed1517f1c9008d4fd09e73967ecb75eeb2b01;p=thirdparty%2FPython%2Fcpython.git Use '127.0.0.1' only on Mac; for other, sane platforms, use 'localhost'. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 2eef833d336f..607458b1dbe1 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1142,8 +1142,9 @@ pydoc by Ka-Ping Yee <ping@lfw.org>""" 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)