summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/locks.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2014-01-10 21:25:38 (GMT)
committerGuido van Rossum <guido@python.org>2014-01-10 21:25:38 (GMT)
commit2407f3bb1bb77ae8e3752e6ff2f89dc5edd3238e (patch)
treebea68ec4f18f3015d70f4d63371d82dead1ee948 /Lib/asyncio/locks.py
parentd9b77c5edf1f2f99b253bdd94661084dba03fe9b (diff)
downloadcpython-2407f3bb1bb77ae8e3752e6ff2f89dc5edd3238e.zip
cpython-2407f3bb1bb77ae8e3752e6ff2f89dc5edd3238e.tar.gz
cpython-2407f3bb1bb77ae8e3752e6ff2f89dc5edd3238e.tar.bz2
asyncio: Don't special-case GeneratorExit in Condition.wait().
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r--Lib/asyncio/locks.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 9e85292..9fdb937 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):