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

Function wrap_future

Lib/asyncio/futures.py:416–426  ·  view source on GitHub ↗

Wrap concurrent.futures.Future object.

(future, *, loop=None)

Source from the content-addressed store, hash-verified

414
415
416def wrap_future(future, *, loop=None):
417 """Wrap concurrent.futures.Future object."""
418 if isfuture(future):
419 return future
420 assert isinstance(future, concurrent.futures.Future), \
421 f'concurrent.futures.Future is expected, got {future!r}'
422 if loop is None:
423 loop = events.get_event_loop()
424 new_future = loop.create_future()
425 _chain_future(future, new_future)
426 return new_future
427
428
429def future_add_to_awaited_by(fut, waiter, /):

Callers

nothing calls this directly

Calls 4

isfutureFunction · 0.85
_chain_futureFunction · 0.85
get_event_loopMethod · 0.45
create_futureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…