Commit 2407f3bb authored by Guido van Rossum's avatar Guido van Rossum

asyncio: Don't special-case GeneratorExit in Condition.wait().

parent d9b77c5e
......@@ -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,12 +261,8 @@ 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()
yield from self.acquire()
@tasks.coroutine
def wait_for(self, predicate):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment