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: ...@@ -251,7 +251,6 @@ class Condition:
if not self.locked(): if not self.locked():
raise RuntimeError('cannot wait on un-acquired lock') raise RuntimeError('cannot wait on un-acquired lock')
keep_lock = True
self.release() self.release()
try: try:
fut = futures.Future(loop=self._loop) fut = futures.Future(loop=self._loop)
...@@ -262,12 +261,8 @@ class Condition: ...@@ -262,12 +261,8 @@ class Condition:
finally: finally:
self._waiters.remove(fut) self._waiters.remove(fut)
except GeneratorExit:
keep_lock = False # Prevent yield in finally clause.
raise
finally: finally:
if keep_lock: yield from self.acquire()
yield from self.acquire()
@tasks.coroutine @tasks.coroutine
def wait_for(self, predicate): 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