From b14ab8a9eac687dad700c773704e2f67bc6ccd9e Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:56:17 +0000 Subject: [PATCH] do not pop future --- Lib/asyncio/streams.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index c21ef7447c93a8..0b46749b7c0a27 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -144,8 +144,7 @@ def resume_writing(self): if self._loop.get_debug(): logger.debug("%r resumes writing", self) - while self._drain_waiters: - waiter = self._drain_waiters.popleft() + for waiter in self._drain_waiters: if not waiter.done(): waiter.set_result(None) @@ -155,8 +154,7 @@ def connection_lost(self, exc): if not self._paused: return - while self._drain_waiters: - waiter = self._drain_waiters.popleft() + for waiter in self._drain_waiters: if not waiter.done(): if exc is None: waiter.set_result(None)