mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
socketserver renaming reversal part 3: move the module into the right
place and fix all references to it. Closes #2926.
This commit is contained in:
parent
6acb075f03
commit
e152a77d96
19 changed files with 409 additions and 411 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