From: deadlovelll <128279579+deadlovelll@users.noreply.github.com> Date: Sat, 23 May 2026 08:46:52 +0000 (+0300) Subject: gh-150116 Remove dead try/except in `asyncio.Lock._wake_up_first` (#150117) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1b20d1933f5a88c52685f1130699f0721bef811b;p=thirdparty%2FPython%2Fcpython.git gh-150116 Remove dead try/except in `asyncio.Lock._wake_up_first` (#150117) --- diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index fa3a94764b50..0d5e362188ab 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -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():