]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-150116 Remove dead try/except in `asyncio.Lock._wake_up_first` (#150117)
authordeadlovelll <128279579+deadlovelll@users.noreply.github.com>
Sat, 23 May 2026 08:46:52 +0000 (11:46 +0300)
committerGitHub <noreply@github.com>
Sat, 23 May 2026 08:46:52 +0000 (14:16 +0530)
Lib/asyncio/locks.py

index fa3a94764b507ae6bb5dcac795e2895dc4ba5946..0d5e362188ab21d1565a4497a26b30093497b92a 100644 (file)
@@ -145,10 +145,7 @@ class Lock(_ContextManagerMixin, mixins._LoopBoundMixin):
         """Ensure that the first waiter will wake up."""
         if not self._waiters:
             return
-        try:
-            fut = next(iter(self._waiters))
-        except StopIteration:
-            return
+        fut = next(iter(self._waiters))
 
         # .done() means that the waiter is already set to wake up.
         if not fut.done():