From 1b3988aa953d993c0fa602021627d3fa81989de8 Mon Sep 17 00:00:00 2001 From: Steffen Neubauer Date: Sat, 7 Sep 2024 14:42:29 +0200 Subject: [PATCH] close implies flush, so no need to flush after every write --- src/click/_termui_impl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/click/_termui_impl.py b/src/click/_termui_impl.py index a3af250c3..77edbd9ab 100644 --- a/src/click/_termui_impl.py +++ b/src/click/_termui_impl.py @@ -424,7 +424,6 @@ def _pipepager(generator: cabc.Iterable[str], cmd: str, color: bool | None) -> N text = strip_ansi(text) stdin.write(text.encode(encoding, "replace")) - stdin.flush() except Exception as e: # In case there is an exception we want to close the pager immediately # and let the caller handle it.