Skip to content

Commit

Permalink
import _imagingcms as core
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Jan 20, 2024
1 parent a21409d commit 2a45ab6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
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
Expand Down Expand Up @@ -119,7 +119,6 @@ def __getattr__(name: str) -> Any:

# --------------------------------------------------------------------.

core = _imagingcms

#
# intent/direction values
Expand Down Expand Up @@ -257,7 +256,7 @@ def __init__(self, profile: str | BinaryIO | core.CmsProfile) -> None:
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]
Expand Down

0 comments on commit 2a45ab6

Please sign in to comment.