MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / exception

Method exception

tools/python-3.11.9-amd64/Lib/asyncio/futures.py:206–220  ·  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

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

Callers 15

failedMethod · 0.95
hashlib.pyFile · 0.45
_copy_future_stateFunction · 0.45
_on_completionFunction · 0.45
_done_callbackFunction · 0.45
_inner_done_callbackFunction · 0.45
_cancel_all_tasksFunction · 0.45
staggered_raceFunction · 0.45
_on_task_doneMethod · 0.45
_run_until_complete_cbFunction · 0.45
run_until_completeMethod · 0.45

Calls 1

_make_cancelled_errorMethod · 0.95

Tested by

no test coverage detected