code: def set_exception(self, exception):
          
          with self.__condition:
              self.__exception = exception
              self.__state = FINISHED
              self.__condition.notify_all()
          self._invoke_callbacks()
docs: Sets the result of the future as being the given exception.
          Only called internally.