mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
asyncio: Don't special-case GeneratorExit in Condition.wait().
This commit is contained in:
parent
d9b77c5edf
commit
2407f3bb1b
1 changed files with 1 additions and 6 deletions
|
@ -251,7 +251,6 @@ class Condition:
|
|||
if not self.locked():
|
||||
raise RuntimeError('cannot wait on un-acquired lock')
|
||||
|
||||
keep_lock = True
|
||||
self.release()
|
||||
try:
|
||||
fut = futures.Future(loop=self._loop)
|
||||
|
@ -262,11 +261,7 @@ class Condition:
|
|||
finally:
|
||||
self._waiters.remove(fut)
|
||||
|
||||
except GeneratorExit:
|
||||
keep_lock = False # Prevent yield in finally clause.
|
||||
raise
|
||||
finally:
|
||||
if keep_lock:
|
||||
yield from self.acquire()
|
||||
|
||||
@tasks.coroutine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue