Skip to content

Commit 63a6530

Browse files
committed
fix mypy error
1 parent b8631fe commit 63a6530

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

stubs/colorful/colorful/__init__.pyi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from _typeshed import SupportsWrite
22
from builtins import str as _str
3-
from typing import ContextManager, Final
3+
from contextlib import AbstractContextManager
4+
from typing import Final
45
from typing_extensions import LiteralString
56

67
from .core import Colorful, ColorfulString, _ColorModeType, _PaletteType
@@ -47,12 +48,12 @@ def print(
4748
) -> None: ...
4849
def with_setup(
4950
colormode: _ColorModeType | None = None, colorpalette: _str | _PaletteType | None = None, extend_colors: bool = False
50-
) -> ContextManager[Colorful]: ...
51-
def with_8_ansi_colors() -> ContextManager[Colorful]: ...
52-
def with_16_ansi_colors() -> ContextManager[Colorful]: ...
53-
def with_256_ansi_colors() -> ContextManager[Colorful]: ...
54-
def with_true_colors() -> ContextManager[Colorful]: ...
55-
def with_palette(colorpalette: _str | _PaletteType) -> ContextManager[Colorful]: ...
56-
def with_updated_palette(colorpalette: _str | _PaletteType) -> ContextManager[Colorful]: ...
57-
def with_style(style_name: _str) -> ContextManager[Colorful]: ...
51+
) -> AbstractContextManager[Colorful]: ...
52+
def with_8_ansi_colors() -> AbstractContextManager[Colorful]: ...
53+
def with_16_ansi_colors() -> AbstractContextManager[Colorful]: ...
54+
def with_256_ansi_colors() -> AbstractContextManager[Colorful]: ...
55+
def with_true_colors() -> AbstractContextManager[Colorful]: ...
56+
def with_palette(colorpalette: _str | _PaletteType) -> AbstractContextManager[Colorful]: ...
57+
def with_updated_palette(colorpalette: _str | _PaletteType) -> AbstractContextManager[Colorful]: ...
58+
def with_style(style_name: _str) -> AbstractContextManager[Colorful]: ...
5859
def __getattr__(name: _str) -> Colorful.ColorfulStyle: ...

0 commit comments

Comments
 (0)