diff options
Diffstat (limited to 'Lib/asyncio/futures.py')
-rw-r--r-- | Lib/asyncio/futures.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index ddb9cde..1feba4d 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -451,6 +451,8 @@ def wrap_future(future, *, loop=None): return future assert isinstance(future, concurrent.futures.Future), \ 'concurrent.futures.Future is expected, got {!r}'.format(future) - new_future = Future(loop=loop) + if loop is None: + loop = events.get_event_loop() + new_future = loop.create_future() _chain_future(future, new_future) return new_future |