mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Updated all import statements to use the new socketserver module name.
Renamed socketserver module in its own documentation. Renamed documentation references.
This commit is contained in:
parent
fb9ce65a91
commit
d192c925ac
14 changed files with 61 additions and 64 deletions
|
|
@ -74,7 +74,7 @@ import sys
|
|||
import time
|
||||
import socket # For gethostbyaddr()
|
||||
import mimetools
|
||||
import SocketServer
|
||||
import socketserver
|
||||
|
||||
# Default error message template
|
||||
DEFAULT_ERROR_MESSAGE = """\
|
||||
|
|
@ -94,19 +94,19 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html"
|
|||
def _quote_html(html):
|
||||
return html.replace("&", "&").replace("<", "<").replace(">", ">")
|
||||
|
||||
class HTTPServer(SocketServer.TCPServer):
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
|
||||
allow_reuse_address = 1 # Seems to make sense in testing environment
|
||||
|
||||
def server_bind(self):
|
||||
"""Override server_bind to store the server name."""
|
||||
SocketServer.TCPServer.server_bind(self)
|
||||
socketserver.TCPServer.server_bind(self)
|
||||
host, port = self.socket.getsockname()[:2]
|
||||
self.server_name = socket.getfqdn(host)
|
||||
self.server_port = port
|
||||
|
||||
|
||||
class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
|
||||
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
|
||||
"""HTTP request handler base class.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue