diff options
author | Georg Brandl <georg@python.org> | 2008-05-26 16:32:26 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-26 16:32:26 (GMT) |
commit | 2442015af26321083d4a2d75c096c8b732f049b2 (patch) | |
tree | 24cb8bc1fd46815ecc6e795cfcc008e7a576c672 /Lib/pydoc.py | |
parent | 744c2cd32585c1aeb1b78063cc6dda740d59c0c0 (diff) | |
download | cpython-2442015af26321083d4a2d75c096c8b732f049b2.zip cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.gz cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.bz2 |
Create http package. #2883.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 140e1d8..42ba266 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1921,7 +1921,7 @@ def apropos(key): # --------------------------------------------------- web browser interface def serve(port, callback=None, completer=None): - import BaseHTTPServer, mimetools, select + import http.server, mimetools, select # Patch up mimetools.Message so it doesn't break if rfc822 is reloaded. class Message(mimetools.Message): @@ -1933,7 +1933,7 @@ def serve(port, callback=None, completer=None): self.parsetype() self.parseplist() - class DocHandler(BaseHTTPServer.BaseHTTPRequestHandler): + class DocHandler(http.server.BaseHTTPRequestHandler): def send_document(self, title, contents): try: self.send_response(200) @@ -1978,7 +1978,7 @@ pydoc</strong> by Ka-Ping Yee <ping@lfw.org></font>''' def log_message(self, *args): pass - class DocServer(BaseHTTPServer.HTTPServer): + class DocServer(http.server.HTTPServer): def __init__(self, port, callback): host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost' self.address = ('', port) @@ -1997,7 +1997,7 @@ pydoc</strong> by Ka-Ping Yee <ping@lfw.org></font>''' self.base.server_activate(self) if self.callback: self.callback(self) - DocServer.base = BaseHTTPServer.HTTPServer + DocServer.base = http.server.HTTPServer DocServer.handler = DocHandler DocHandler.MessageClass = Message try: |