https://github.com/python/cpython/commit/1b20d1933f5a88c52685f1130699f0721bef811b
commit: 1b20d1933f5a88c52685f1130699f0721bef811b
branch: main
author: deadlovelll <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-05-23T14:16:52+05:30
summary:
gh-150116 Remove dead try/except in `asyncio.Lock._wake_up_first` (#150117)
files:
M Lib/asyncio/locks.py
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():
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]