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: