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

Method exception

Lib/asyncio/futures.py:211–224  ·  view source on GitHub ↗

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.

(self)

Source from the content-addressed store, hash-verified

209 return self._result
210
211 def exception(self):
212 """Return the exception that was set on this future.
213
214 The exception (or None if no exception was set) is returned only if
215 the future is done. If the future has been cancelled, raises
216 CancelledError. If the future isn't done yet, raises
217 InvalidStateError.
218 """
219 if self._state == _CANCELLED:
220 raise self._make_cancelled_error()
221 if self._state != _FINISHED:
222 raise exceptions.InvalidStateError('Exception is not set.')
223 self.__log_traceback = False
224 return self._exception
225
226 def add_done_callback(self, fn, *, context=None):
227 """Add a callback to be run when the future becomes done.

Callers 15

hashlib.pyFile · 0.45
traceFunction · 0.45
print_excFunction · 0.45
format_excFunction · 0.45
__exit__Method · 0.45
__aexit__Method · 0.45
_copy_future_stateFunction · 0.45
_on_completionFunction · 0.45
_done_callbackFunction · 0.45
_log_on_exceptionFunction · 0.45
_inner_done_callbackFunction · 0.45

Calls 1

_make_cancelled_errorMethod · 0.95

Tested by

no test coverage detected