summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/selector_events.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/selector_events.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/selector_events.py')
-rw-r--r--Lib/asyncio/selector_events.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 7b5a084..b34fee3 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -196,7 +196,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
transport = None
try:
protocol = protocol_factory()
- waiter = futures.Future(loop=self)
+ waiter = self.create_future()
if sslcontext:
transport = self._make_ssl_transport(
conn, protocol, sslcontext, waiter=waiter,
@@ -314,7 +314,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
"""
if self._debug and sock.gettimeout() != 0:
raise ValueError("the socket must be non-blocking")
- fut = futures.Future(loop=self)
+ fut = self.create_future()
self._sock_recv(fut, False, sock, n)
return fut
@@ -352,7 +352,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
"""
if self._debug and sock.gettimeout() != 0:
raise ValueError("the socket must be non-blocking")
- fut = futures.Future(loop=self)
+ fut = self.create_future()
if data:
self._sock_sendall(fut, False, sock, data)
else:
@@ -395,7 +395,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
"""
if self._debug and sock.gettimeout() != 0:
raise ValueError("the socket must be non-blocking")
- fut = futures.Future(loop=self)
+ fut = self.create_future()
try:
base_events._check_resolved_address(sock, address)
except ValueError as err:
@@ -453,7 +453,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
"""
if self._debug and sock.gettimeout() != 0:
raise ValueError("the socket must be non-blocking")
- fut = futures.Future(loop=self)
+ fut = self.create_future()
self._sock_accept(fut, False, sock)
return fut