Sets the result of the future as being the given exception.
        Only called internally.

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