summaryrefslogtreecommitdiff
path: root/Lib/asyncio/locks.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2016-05-16 15:38:39 -0400
committerYury Selivanov <yselivanov@sprymix.com>2016-05-16 15:38:39 -0400
commit7661db622892c9731c502ccdd7af130cbfd23f5c (patch)
tree3d0d940b0a5a26a1a89e27f6e4969ae612a9cb9b /Lib/asyncio/locks.py
parent7ed7ce6ee76c1e4aaa94151f156fb2ba5163b5b2 (diff)
downloadcpython-git-7661db622892c9731c502ccdd7af130cbfd23f5c.tar.gz
Issue #27041: asyncio: Add loop.create_future method
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r--Lib/asyncio/locks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 34f6bc16ad..1804d7b864 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -170,7 +170,7 @@ class Lock(_ContextManagerMixin):
self._locked = True
return True
- fut = futures.Future(loop=self._loop)
+ fut = self._loop.create_future()
self._waiters.append(fut)
try:
yield from fut
@@ -258,7 +258,7 @@ class Event:
if self._value:
return True
- fut = futures.Future(loop=self._loop)
+ fut = self._loop.create_future()
self._waiters.append(fut)
try:
yield from fut
@@ -320,7 +320,7 @@ class Condition(_ContextManagerMixin):
self.release()
try:
- fut = futures.Future(loop=self._loop)
+ fut = self._loop.create_future()
self._waiters.append(fut)
try:
yield from fut
@@ -433,7 +433,7 @@ class Semaphore(_ContextManagerMixin):
True.
"""
while self._value <= 0:
- fut = futures.Future(loop=self._loop)
+ fut = self._loop.create_future()
self._waiters.append(fut)
try:
yield from fut