colorama: Preserve input type for wrap_stream (#9677)

This commit is contained in:
Jelle Zijlstra
2023-02-06 06:50:21 -08:00
committed by GitHub
parent ccb250940a
commit c65a87481d

View File

@@ -1,8 +1,10 @@
from contextlib import AbstractContextManager
from typing import Any, TextIO
from typing import Any, TextIO, TypeVar
from .ansitowin32 import StreamWrapper
_TextIOT = TypeVar("_TextIOT", bound=TextIO)
orig_stdout: TextIO | None
orig_stderr: TextIO | None
wrapped_stdout: TextIO | StreamWrapper
@@ -16,6 +18,6 @@ def deinit() -> None: ...
def colorama_text(*args: Any, **kwargs: Any) -> AbstractContextManager[None]: ...
def reinit() -> None: ...
def wrap_stream(
stream: TextIO, convert: bool | None, strip: bool | None, autoreset: bool, wrap: bool
) -> TextIO | StreamWrapper: ...
stream: _TextIOT, convert: bool | None, strip: bool | None, autoreset: bool, wrap: bool
) -> _TextIOT | StreamWrapper: ...
def just_fix_windows_console() -> None: ...