code: def exception(self, timeout=None):
          
          if not self._done.wait(timeout):
              raise Timeout('timeout waiting for future')
          if self._state == self.S_EXCEPTION:
              return self._result
docs: Wait for the async function to complete and return its exception.
  
          If the function did not raise an exception this returns ``None``.