summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-06-11 16:01:19 (GMT)
committerYury Selivanov <yury@magic.io>2016-06-11 16:01:19 (GMT)
commitd35bf032840bcbf130a146eb35e332f9fa925cd9 (patch)
tree951fd8ee6cf110cf144f1ce5f5c7a6fb32341ac4 /Lib/asyncio
parent6588712bf02e8e9ee374c92e2c1333f2f0029dc2 (diff)
parentc92bf83a829956e683a3d6bb1ae65aed74d7b92a (diff)
downloadcpython-d35bf032840bcbf130a146eb35e332f9fa925cd9.zip
cpython-d35bf032840bcbf130a146eb35e332f9fa925cd9.tar.gz
cpython-d35bf032840bcbf130a146eb35e332f9fa925cd9.tar.bz2
Merge 3.5 (issue #22970)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/locks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 842d621..741aaf2 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -329,7 +329,13 @@ class Condition(_ContextManagerMixin):
self._waiters.remove(fut)
finally:
- yield from self.acquire()
+ # Must reacquire lock even if wait is cancelled
+ while True:
+ try:
+ yield from self.acquire()
+ break
+ except futures.CancelledError:
+ pass
@coroutine
def wait_for(self, predicate):