mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-15 06:07:33 +03:00
Conditionally define type hint to avoid requiring core
This commit is contained in:
parent
51bd7d2ea8
commit
a34ac045c3
|
@ -31,6 +31,10 @@ from ._typing import SupportsRead
|
|||
|
||||
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.
|
||||
|
@ -391,10 +395,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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user