From: Guido van Rossum Date: Fri, 10 Jan 2014 21:25:38 +0000 (-0800) Subject: asyncio: Don't special-case GeneratorExit in Condition.wait(). X-Git-Tag: v3.4.0b3~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2407f3bb1bb77ae8e3752e6ff2f89dc5edd3238e;p=thirdparty%2FPython%2Fcpython.git asyncio: Don't special-case GeneratorExit in Condition.wait(). --- diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index 9e8529249eb7..9fdb93745b61 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -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):