diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index a21a22d4064f77f..85b9b0b1bf9e365 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)