Skip to content

Commit

Permalink
Test removng of type: ignore when win32 mypy "magic" check is used
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBackx committed Nov 9, 2024
1 parent 63db9af commit 4ed4690
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/click/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from types import TracebackType
from weakref import WeakKeyDictionary

CYGWIN = sys.platform.startswith("cygwin")
WIN = sys.platform.startswith("win")
CYGWIN = sys.platform == "cygwin"
WIN = sys.platform == "win32"
auto_wrap_for_ansi: t.Callable[[t.TextIO], t.TextIO] | None = None
_ansi_re = re.compile(r"\033\[[;?0-9]*[a-zA-Z]")

Expand Down
6 changes: 3 additions & 3 deletions src/click/_termui_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def _translate_ch_to_exc(ch: str) -> None:
return None


if WIN:
if sys.platform == "win32":
import msvcrt

@contextlib.contextmanager
Expand Down Expand Up @@ -706,9 +706,9 @@ def getchar(echo: bool) -> str:
func: t.Callable[[], str]

if echo:
func = msvcrt.getwche # type: ignore
func = msvcrt.getwche
else:
func = msvcrt.getwch # type: ignore
func = msvcrt.getwch

rv = func()

Expand Down

0 comments on commit 4ed4690

Please sign in to comment.