Skip to content

Commit 3ff96ae

Browse files
committed
Fix mypy for _winapi usage in _pyrepl
1 parent 4dfefb8 commit 3ff96ae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/_pyrepl/windows_console.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def __init__(self, err: int | None, descr: str | None = None) -> None:
6666
self.err = err
6767
self.descr = descr
6868

69+
_winapi: types.ModuleType | None
6970
try:
7071
import _winapi
7172
except ImportError:
@@ -702,7 +703,9 @@ def wait_for_event(self, timeout: float | None) -> bool:
702703
else:
703704
timeout = int(timeout)
704705
assert _winapi is not None # to make mypy happy
705-
ret = _winapi.WaitForSingleObject(InHandle, timeout)
706+
ret = _winapi.WaitForSingleObject( # type: ignore[attr-defined]
707+
InHandle, timeout
708+
)
706709
if ret == WAIT_FAILED:
707710
raise WinError(get_last_error())
708711
elif ret == WAIT_TIMEOUT:

0 commit comments

Comments
 (0)