560
563
self.server = self.create_server()
561
564
self._server_thread = ThreadWithException(
562
565
event=self.server.started,
565
567
self._server_thread.start()
566
568
# Wait for the server thread to start (i.e release the lock)
567
569
self.server.started.wait()
570
570
# Get the real address, especially the port
571
571
self.host, self.port = self.server.server_address
572
575
# If an exception occured during the server start, it will get raised,
573
576
# otherwise, the server is blocked on its accept() call.
574
577
self._server_thread.pending_exception()