From 88b8e313f7ec09ddd16f33bded0b4c39d7935f58 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/click/testing.py b/src/click/testing.py index d4473ca9d..19fae4a62 100644 --- a/src/click/testing.py +++ b/src/click/testing.py @@ -22,7 +22,10 @@ from .core import Command -CaptureMode: t.TypeAlias = 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] ExceptionInfo: t.TypeAlias = tuple[type[BaseException], BaseException, TracebackType]