mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-10 00:20:57 +03:00
Merge pull request #8197 from radarhere/imagecms_core
Conditionally define ImageCms type hint to avoid requiring core
This commit is contained in:
commit
b0d79c87f1
|
@ -121,7 +121,7 @@ nitpicky = True
|
||||||
# generating warnings in “nitpicky mode”. Note that type should include the domain name
|
# generating warnings in “nitpicky mode”. Note that type should include the domain name
|
||||||
# if present. Example entries would be ('py:func', 'int') or
|
# if present. Example entries would be ('py:func', 'int') or
|
||||||
# ('envvar', 'LD_LIBRARY_PATH').
|
# ('envvar', 'LD_LIBRARY_PATH').
|
||||||
nitpick_ignore = [("py:class", "_io.BytesIO")]
|
nitpick_ignore = [("py:class", "_io.BytesIO"), ("py:class", "_CmsProfileCompatible")]
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output ----------------------------------------------
|
# -- Options for HTML output ----------------------------------------------
|
||||||
|
|
|
@ -31,6 +31,10 @@ from ._typing import SupportsRead
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from . import _imagingcms as core
|
from . import _imagingcms as core
|
||||||
|
|
||||||
|
_CmsProfileCompatible = Union[
|
||||||
|
str, SupportsRead[bytes], core.CmsProfile, "ImageCmsProfile"
|
||||||
|
]
|
||||||
except ImportError as ex:
|
except ImportError as ex:
|
||||||
# Allow error import for doc purposes, but error out when accessing
|
# Allow error import for doc purposes, but error out when accessing
|
||||||
# anything in core.
|
# anything in core.
|
||||||
|
@ -389,10 +393,6 @@ def get_display_profile(handle: SupportsInt | None = None) -> ImageCmsProfile |
|
||||||
# pyCMS compatible layer
|
# pyCMS compatible layer
|
||||||
# --------------------------------------------------------------------.
|
# --------------------------------------------------------------------.
|
||||||
|
|
||||||
_CmsProfileCompatible = Union[
|
|
||||||
str, SupportsRead[bytes], core.CmsProfile, ImageCmsProfile
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class PyCMSError(Exception):
|
class PyCMSError(Exception):
|
||||||
"""(pyCMS) Exception class.
|
"""(pyCMS) Exception class.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user