MCPcopy Index your code
hub / github.com/python/cpython / _set_result_unless_cancelled

Function _set_result_unless_cancelled

Lib/asyncio/futures.py:323–327  ·  view source on GitHub ↗

Helper setting the result only if the future was not cancelled.

(fut, result)

Source from the content-addressed store, hash-verified

321
322
323def _set_result_unless_cancelled(fut, result):
324 """Helper setting the result only if the future was not cancelled."""
325 if fut.cancelled():
326 return
327 fut.set_result(result)
328
329
330def _convert_future_exc(exc):

Callers

nothing calls this directly

Calls 2

cancelledMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…