Skip to content

Commit

Permalink
Only use core in type hints when TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jul 2, 2024
1 parent c8df36f commit 314d1b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import sys
from enum import IntEnum, IntFlag
from functools import reduce
from typing import Any, Literal, SupportsFloat, SupportsInt, Union
from typing import Any, Literal, SupportsFloat, SupportsInt, Union, TYPE_CHECKING

from . import Image, __version__
from ._deprecate import deprecate
Expand Down Expand Up @@ -391,9 +391,10 @@ def get_display_profile(handle: SupportsInt | None = None) -> ImageCmsProfile |
# pyCMS compatible layer
# --------------------------------------------------------------------.

_CmsProfileCompatible = Union[
str, SupportsRead[bytes], core.CmsProfile, ImageCmsProfile
]
if TYPE_CHECKING:
_CmsProfileCompatible = Union[
str, SupportsRead[bytes], core.CmsProfile, ImageCmsProfile
]


class PyCMSError(Exception):
Expand Down

0 comments on commit 314d1b7

Please sign in to comment.