Skip to content

Commit

Permalink
Merge pull request #8197 from radarhere/imagecms_core
Browse files Browse the repository at this point in the history
Conditionally define ImageCms type hint to avoid requiring core
  • Loading branch information
hugovk authored Oct 12, 2024
2 parents fd74857 + 72bc56b commit b0d79c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
# generating warnings in “nitpicky mode”. Note that type should include the domain name
# if present. Example entries would be ('py:func', 'int') or
# ('envvar', 'LD_LIBRARY_PATH').
nitpick_ignore = [("py:class", "_io.BytesIO")]
nitpick_ignore = [("py:class", "_io.BytesIO"), ("py:class", "_CmsProfileCompatible")]


# -- Options for HTML output ----------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

try:
from . import _imagingcms as core

_CmsProfileCompatible = Union[
str, SupportsRead[bytes], core.CmsProfile, "ImageCmsProfile"
]
except ImportError as ex:
# Allow error import for doc purposes, but error out when accessing
# anything in core.
Expand Down Expand Up @@ -389,10 +393,6 @@ def get_display_profile(handle: SupportsInt | None = None) -> ImageCmsProfile |
# pyCMS compatible layer
# --------------------------------------------------------------------.

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


class PyCMSError(Exception):
"""(pyCMS) Exception class.
Expand Down

0 comments on commit b0d79c8

Please sign in to comment.