code: def waitResult(self):
      
      self.thread.execute_queue.join()
      try:
        e = self.thread.exception_queue[threading.get_ident()].get_nowait()
      except queue.Empty:
        return self.thread.result_queue[threading.get_ident()].get_nowait()
      else:
        raise e
docs: Wait for the execution of the last enqueued job to be done, and return the result or raise an exception.