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

This commit is contained in:
Guido van Rossum 2014-01-10 13:25:38 -08:00
parent d9b77c5edf
commit 2407f3bb1b
1 changed files with 1 additions and 6 deletions

View File

@ -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):