Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/click/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@

from .core import Command

CaptureMode: t.TypeAlias = t.Literal["sys", "fd"]
if sys.platform == "win32":
Comment thread
kdeldycke marked this conversation as resolved.
CaptureMode: t.TypeAlias = t.Literal["sys"] # pyright: ignore[reportRedeclaration]
else:
CaptureMode: t.TypeAlias = t.Literal["sys", "fd"] # pyright: ignore[reportRedeclaration]
Comment on lines +25 to +28
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how you would make pyright happy here... 🤔️ Anyhow, this should still be fine I believe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no redeclaration because these branches are mutually exclusive. So I'd say that this is false positive error, i.e. a bug in pyright, justifying this # pyright: ignore

ExceptionInfo: t.TypeAlias = tuple[type[BaseException], BaseException, TracebackType]


Expand Down
Loading