(self)
return self._exception
Return the exception that was set on this future.

        The exception (or None if no exception was set) is returned only if
        the future is done.  If the future has been cancelled, raises
        CancelledError.  If the future isn't done yet, raises
        InvalidStateError.
Return the exception that was set on this future.
Return the exception that was set on this future .
def exception(self):
        """Return the exception that was set on this future.

        The exception (or None if no exception was set) is returned only if
        the future is done.  If the future has been cancelled, raises
        CancelledError.  If the future isn't done yet, raises
        InvalidStateError.
        """
        if self._state == _CANCELLED:
            exc = self._make_cancelled_error()
            raise exc
        if self._state != _FINISHED:
            raise exceptions.InvalidStateError('Exception is not set.')
        self.__log_traceback = False
        return self._exception
def exception ( self ) : if self . _state == _CANCELLED : exc = self . _make_cancelled_error ( ) raise exc if self . _state != _FINISHED : raise exceptions . InvalidStateError ( 'Exception is not set.' ) self . __log_traceback = False return self . _exception