From: Timofei <128279579+deadlovelll@users.noreply.github.com> Date: Wed, 8 Jul 2026 10:15:18 +0000 (+0300) Subject: gh-149740: Remove redundant self.empty() check in asyncio.Queue.get() (#149741) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=754b9f28b31e659691e1f3954c9606d0ef064d5d;p=thirdparty%2FPython%2Fcpython.git gh-149740: Remove redundant self.empty() check in asyncio.Queue.get() (#149741) Co-authored-by: Kumar Aditya --- diff --git a/Lib/asyncio/queues.py b/Lib/asyncio/queues.py index 30004f2bc9ba..8871cdc16c68 100644 --- a/Lib/asyncio/queues.py +++ b/Lib/asyncio/queues.py @@ -178,7 +178,7 @@ class Queue(mixins._LoopBoundMixin): or if the queue has been shut down immediately. """ while self.empty(): - if self._is_shutdown and self.empty(): + if self._is_shutdown: raise QueueShutDown getter = self._get_loop().create_future() self._getters.append(getter)