summaryrefslogtreecommitdiff
path: root/Lib/asyncio/locks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r--Lib/asyncio/locks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 508a2142d8..91f7a01de8 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -358,12 +358,16 @@ class Condition(_ContextManagerMixin):
finally:
# Must reacquire lock even if wait is cancelled
+ cancelled = False
while True:
try:
await self.acquire()
break
except futures.CancelledError:
- pass
+ cancelled = True
+
+ if cancelled:
+ raise futures.CancelledError
async def wait_for(self, predicate):
"""Wait until a predicate becomes true.