

def exception(self, timeout=None):
    "Return the exception raised by the call that the future represents.\n\n        Args:\n            timeout: The number of seconds to wait for the exception if the\n                future isn't done. If None, then there is no limit on the wait\n                time.\n\n        Returns:\n            The exception raised by the call that the future represents or None\n            if the call completed without raising.\n\n        Raises:\n            CancelledError: If the future was cancelled.\n            TimeoutError: If the future didn't finish executing before the given\n                timeout.\n        "
    with self._condition:
        if (self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]):
            raise CancelledError()
        elif (self._state == FINISHED):
            return self._exception
        self._condition.wait(timeout)
        if (self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]):
            raise CancelledError()
        elif (self._state == FINISHED):
            return self._exception
        else:
            raise TimeoutError()

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/concurrent/concurrent/futures/_base.py Future.exception/original