From fb6c1d9498db63807522108ca83e3777a5020dd5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 25 Jan 2025 20:33:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/PIL/ImageDraw.py | 4 ++-- src/PIL/_typing.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/PIL/ImageDraw.py b/src/PIL/ImageDraw.py index 455a93b68..af1ebd2e2 100644 --- a/src/PIL/ImageDraw.py +++ b/src/PIL/ImageDraw.py @@ -39,7 +39,7 @@ from typing import TYPE_CHECKING, Any, AnyStr, Callable, Union, cast from . import Image, ImageColor from ._deprecate import deprecate -from ._typing import Coords, Anchor, Align, Direction +from ._typing import Align, Anchor, Coords, Direction # experimental access to the outline API Outline: Callable[[], Image.core._Outline] | None @@ -241,7 +241,7 @@ class ImageDraw: xy: Coords, fill: _Ink | None = None, width: int = 0, - joint: Literal["curve"] | None = None, + joint: Literal[curve] | None = None, ) -> None: """Draw a line, or a connected sequence of line segments.""" ink = self._getink(fill)[0] diff --git a/src/PIL/_typing.py b/src/PIL/_typing.py index 2b0930323..862c703f8 100644 --- a/src/PIL/_typing.py +++ b/src/PIL/_typing.py @@ -3,7 +3,7 @@ from __future__ import annotations import os import sys from collections.abc import Sequence -from typing import TYPE_CHECKING, Any, Protocol, TypeVar, Union, Literal +from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeVar, Union if TYPE_CHECKING: from numbers import _IntegralLike as IntegralLike @@ -51,7 +51,13 @@ StrOrBytesPath = Union[str, bytes, os.PathLike[str], os.PathLike[bytes]] horizontal_anchors = ("l", "m", "r", "s") vertical_anchors = ("a", "t", "m", "s", "b", "d") -Anchor = Literal[*(horizontal_anchor + vertical_anchor for horizontal_anchor in horizontal_anchors for vertical_anchor in vertical_anchors)] +Anchor = Literal[ + *( + horizontal_anchor + vertical_anchor + for horizontal_anchor in horizontal_anchors + for vertical_anchor in vertical_anchors + ) +] Align = Literal["left", "center", "right"]