summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/futures.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2016-05-16 19:38:39 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2016-05-16 19:38:39 (GMT)
commit7661db622892c9731c502ccdd7af130cbfd23f5c (patch)
tree3d0d940b0a5a26a1a89e27f6e4969ae612a9cb9b /Lib/asyncio/futures.py
parent7ed7ce6ee76c1e4aaa94151f156fb2ba5163b5b2 (diff)
downloadcpython-7661db622892c9731c502ccdd7af130cbfd23f5c.zip
cpython-7661db622892c9731c502ccdd7af130cbfd23f5c.tar.gz
cpython-7661db622892c9731c502ccdd7af130cbfd23f5c.tar.bz2
Issue #27041: asyncio: Add loop.create_future method
Diffstat (limited to 'Lib/asyncio/futures.py')
-rw-r--r--Lib/asyncio/futures.py4
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