diff options
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r-- | Lib/asyncio/locks.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index 9e8529249e..9fdb93745b 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): |