From 83953ab82f76c01551be2ef65042461168be4e1a Mon Sep 17 00:00:00 2001 From: Timofey Ivankov Date: Tue, 19 May 2026 23:43:35 +0300 Subject: [PATCH] Remove dead try/except in asyncio.Lock._wake_up_first --- Lib/asyncio/locks.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index fa3a94764b507ae..0d5e362188ab21d 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -145,10 +145,7 @@ def _wake_up_first(self): """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():