From bd0c361480ad9939821e38e8169cbdaa13c74edc Mon Sep 17 00:00:00 2001 From: jorenham Date: Mon, 18 May 2026 15:03:57 +0200 Subject: [PATCH] platform-dependent `testing.CaptureMode` type alias --- src/click/testing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/click/testing.py b/src/click/testing.py index 1eb81d29ed..7d0100bc06 100644 --- a/src/click/testing.py +++ b/src/click/testing.py @@ -22,7 +22,11 @@ from .core import Command -CaptureMode = t.Literal["sys", "fd"] + +if sys.platform == "win32": + CaptureMode: t.TypeAlias = t.Literal["sys"] # pyright: ignore[reportRedeclaration] +else: + CaptureMode: t.TypeAlias = t.Literal["sys", "fd"] # pyright: ignore[reportRedeclaration] class EchoingStdin: