mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #22970: asyncio: Fix inconsistency cancelling Condition.wait.
Patch by David Coles.
This commit is contained in:
parent
ca2e0a48cf
commit
c92bf83a82
3 changed files with 35 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue