MCPcopy Index your code
hub / github.com/python/cpython / result

Method result

Lib/asyncio/futures.py:199–213  ·  view source on GitHub ↗

Return the result this future represents. If the future has been cancelled, raises CancelledError. If the future's result isn't yet available, raises InvalidStateError. If the future is done and has an exception set, this exception is raised.

(self)

Source from the content-addressed store, hash-verified

197 return self._state != _PENDING
198
199 def result(self):
200 """Return the result this future represents.
201
202 If the future has been cancelled, raises CancelledError. If the
203 future's result isn't yet available, raises InvalidStateError. If
204 the future is done and has an exception set, this exception is raised.
205 """
206 if self._state == _CANCELLED:
207 raise self._make_cancelled_error()
208 if self._state != _FINISHED:
209 raise exceptions.InvalidStateError('Result is not ready.')
210 self.__log_traceback = False
211 if self._exception is not None:
212 raise self._exception.with_traceback(self._exception_tb)
213 return self._result
214
215 def exception(self):
216 """Return the exception that was set on this future.

Callers 15

runcodeMethod · 0.95
__await__Method · 0.95
gather_idsFunction · 0.45
loop_accept_pipeMethod · 0.45
__wakeupMethod · 0.45
wait_forFunction · 0.45
_wait_for_oneMethod · 0.45
_done_callbackFunction · 0.45
_inner_done_callbackFunction · 0.45
_loop_readingMethod · 0.45

Calls 1

_make_cancelled_errorMethod · 0.95

Tested by 1