Skip to content

Commit 7c2ae1e

Browse files
style(pre-commit): auto fixes from pre-commit.com hooks
1 parent 9116f68 commit 7c2ae1e

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

discord/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
from .permissions import PermissionOverwrite, Permissions
5757
from .role import Role
5858
from .scheduled_events import ScheduledEvent
59+
from .shared_client_theme import SharedClientThemeBaseType
5960
from .sticker import GuildSticker, StickerItem
6061
from .utils import warn_deprecated
61-
from .shared_client_theme import SharedClientThemeBaseType
6262

6363
__all__ = (
6464
"Snowflake",

discord/shared_client_theme.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@
3838
ColourLike = Union[Colour, str, int]
3939

4040

41-
def _coerce_colour(value: "ColourLike") -> str:
41+
def _coerce_colour(value: ColourLike) -> str:
4242
if isinstance(value, Colour):
4343
return f"{value.value:0>6x}"
4444
if isinstance(value, int):
4545
return f"{value:0>6x}"
4646
if isinstance(value, str):
4747
stripped = value.lstrip("#")
48-
if len(stripped) != 6 or any(c not in "0123456789abcdefABCDEF" for c in stripped):
48+
if len(stripped) != 6 or any(
49+
c not in "0123456789abcdefABCDEF" for c in stripped
50+
):
4951
raise ValueError(
5052
f"{value!r} is not a valid hexadecimal color (expected format: 'rrggbb')"
5153
)
5254
return stripped.lower()
53-
raise TypeError(
54-
f"colors must be Colour, str, or int, not {type(value).__name__}"
55-
)
55+
raise TypeError(f"colors must be Colour, str, or int, not {type(value).__name__}")
5656

5757

5858
class SharedClientTheme:
@@ -80,7 +80,7 @@ class SharedClientTheme:
8080

8181
def __init__(
8282
self,
83-
colors: Iterable["ColourLike"],
83+
colors: Iterable[ColourLike],
8484
*,
8585
gradient_angle: int,
8686
base_mix: int,
@@ -105,9 +105,7 @@ def __init__(
105105
if base_theme is not None and not isinstance(
106106
base_theme, SharedClientThemeBaseType
107107
):
108-
raise TypeError(
109-
"base_theme must be a SharedClientThemeBaseType or None"
110-
)
108+
raise TypeError("base_theme must be a SharedClientThemeBaseType or None")
111109

112110
self.colors: list[str] = normalized
113111
self.gradient_angle: int = gradient_angle

0 commit comments

Comments
 (0)