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

Method _make_cancelled_error

Lib/asyncio/futures.py:135–150  ·  view source on GitHub ↗

Create the CancelledError to raise if the Future is cancelled. This should only be called once when handling a cancellation since it erases the saved context exception value.

(self)

Source from the content-addressed store, hash-verified

133 return loop
134
135 def _make_cancelled_error(self):
136 """Create the CancelledError to raise if the Future is cancelled.
137
138 This should only be called once when handling a cancellation since
139 it erases the saved context exception value.
140 """
141 if self._cancelled_exc is not None:
142 exc = self._cancelled_exc
143 self._cancelled_exc = None
144 return exc
145
146 if self._cancel_message is None:
147 exc = exceptions.CancelledError()
148 else:
149 exc = exceptions.CancelledError(self._cancel_message)
150 return exc
151
152 def cancel(self, msg=None):
153 """Cancel the future and schedule callbacks.

Callers 4

resultMethod · 0.95
exceptionMethod · 0.95
__stepMethod · 0.45
_done_callbackFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected