(future, *, loop=None)
return new_future
Wrap concurrent.futures.Future object.
Wrap concurrent.futures.Future object.
Wrap concurrent . futures . Future object .
def wrap_future(future, *, loop=None):
    """Wrap concurrent.futures.Future object."""
    if isfuture(future):
        return future
    assert isinstance(future, concurrent.futures.Future), \
        f'concurrent.futures.Future is expected, got {future!r}'
    if loop is None:
        loop = events._get_event_loop()
    new_future = loop.create_future()
    _chain_future(future, new_future)
    return new_future
def wrap_future ( future , * , loop = None ) : if isfuture ( future ) : return future assert isinstance ( future , concurrent . futures . Future ) , f'concurrent.futures.Future is expected, got {future!r}' if loop is None : loop = events . _get_event_loop ( ) new_future = loop . create_future ( ) _chain_future ( future , new_future ) return new_future