diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index ec10230f1..ce5b6101b 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -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.