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

Method set_exception

Lib/concurrent/futures/_base.py:552–565  ·  view source on GitHub ↗

Sets the result of the future as being the given exception. Should only be used by Executor implementations and unit tests.

(self, exception)

Source from the content-addressed store, hash-verified

550 self._invoke_callbacks()
551
552 def set_exception(self, exception):
553 """Sets the result of the future as being the given exception.
554
555 Should only be used by Executor implementations and unit tests.
556 """
557 with self._condition:
558 if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
559 raise InvalidStateError('{}: {!r}'.format(self._state, self))
560 self._exception = exception
561 self._state = FINISHED
562 for waiter in self._waiters:
563 waiter.add_exception(self)
564 self._condition.notify_all()
565 self._invoke_callbacks()
566
567 __class_getitem__ = classmethod(types.GenericAlias)
568

Callers 5

runMethod · 0.45
_initializer_failedMethod · 0.45
process_result_itemMethod · 0.45
_terminate_brokenMethod · 0.45

Calls 5

_invoke_callbacksMethod · 0.95
InvalidStateErrorClass · 0.70
formatMethod · 0.45
add_exceptionMethod · 0.45
notify_allMethod · 0.45

Tested by

no test coverage detected