def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True): # Prevent "address already in use" errors when running tests 2x in a # row. self.allow_reuse_address = True # Handle network family/host addr (see docstring for _socket_info) family, addr = self._socket_info(server_address) self.address_family = family TCPServer.__init__(self, addr, RequestHandlerClass, bind_and_activate)