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

Function _set_concurrent_future_state

Lib/asyncio/futures.py:340–352  ·  view source on GitHub ↗

Copy state from a future to a concurrent.futures.Future.

(concurrent, source)

Source from the content-addressed store, hash-verified

338
339
340def _set_concurrent_future_state(concurrent, source):
341 """Copy state from a future to a concurrent.futures.Future."""
342 assert source.done()
343 if source.cancelled():
344 concurrent.cancel()
345 if not concurrent.set_running_or_notify_cancel():
346 return
347 exception = source.exception()
348 if exception is not None:
349 concurrent.set_exception(_convert_future_exc(exception))
350 else:
351 result = source.result()
352 concurrent.set_result(result)
353
354
355def _copy_future_state(source, dest):

Callers 1

_set_stateFunction · 0.85

Calls 9

_convert_future_excFunction · 0.85
doneMethod · 0.45
cancelledMethod · 0.45
cancelMethod · 0.45
exceptionMethod · 0.45
set_exceptionMethod · 0.45
resultMethod · 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…