From afd6e1fa297d60696f05923097c01b1846de4b49 Mon Sep 17 00:00:00 2001 From: Nulano Date: Mon, 1 Jan 2024 02:36:46 +0100 Subject: [PATCH] import _imagingcms as core --- src/PIL/ImageCms.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index c76241912..022967025 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -29,13 +29,13 @@ from . import Image, __version__ from ._deprecate import deprecate try: - from . import _imagingcms + from . import _imagingcms as core except ImportError as ex: # Allow error import for doc purposes, but error out when accessing # anything in core. from ._util import DeferredError - _imagingcms = DeferredError.new(ex) + core = DeferredError.new(ex) _DESCRIPTION = """ pyCMS @@ -119,7 +119,6 @@ def __getattr__(name: str) -> Any: # --------------------------------------------------------------------. -core = _imagingcms # # intent/direction values @@ -257,7 +256,7 @@ class ImageCmsProfile: self._set(core.profile_open(profile), profile) elif hasattr(profile, "read"): self._set(core.profile_frombytes(profile.read())) - elif isinstance(profile, _imagingcms.CmsProfile): + elif isinstance(profile, core.CmsProfile): self._set(profile) else: msg = "Invalid type for Profile" # type: ignore[unreachable]