MCPcopy Index your code
hub / github.com/RustPython/RustPython / result

Method result

Lib/asyncio/futures.py:195–209  ·  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

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

Callers 15

runcodeMethod · 0.95
__await__Method · 0.95
loop_accept_pipeMethod · 0.45
_copy_future_stateFunction · 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 2

_make_cancelled_errorMethod · 0.95
with_tracebackMethod · 0.80

Tested by 1