]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149740: Remove redundant self.empty() check in asyncio.Queue.get() (#149741)
authorTimofei <128279579+deadlovelll@users.noreply.github.com>
Wed, 8 Jul 2026 10:15:18 +0000 (13:15 +0300)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 10:15:18 +0000 (10:15 +0000)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Lib/asyncio/queues.py

index 30004f2bc9bacd2b02d9f6ddea7b92dc42a6da09..8871cdc16c68b33d473bff0af392fe3f0344bb3b 100644 (file)
@@ -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)