From 7713df961dd37a548dc976ed2bc1602d316b51c0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 16 Jun 2025 18:41:00 +1000 Subject: [PATCH] Removed ImageCms._set --- Tests/test_imagecms.py | 5 +---- docs/deprecations.rst | 9 --------- src/PIL/ImageCms.py | 9 --------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Tests/test_imagecms.py b/Tests/test_imagecms.py index 11c946291..9ee2c71ec 100644 --- a/Tests/test_imagecms.py +++ b/Tests/test_imagecms.py @@ -710,8 +710,7 @@ def test_deprecation() -> None: with pytest.warns(DeprecationWarning): assert isinstance(ImageCms.FLAGS, dict) - p = ImageCms.createProfile("sRGB") - profile = ImageCmsProfile(p) + profile = ImageCmsProfile(ImageCms.createProfile("sRGB")) with pytest.warns(DeprecationWarning): ImageCms.ImageCmsTransform(profile, profile, "RGBA;16B", "RGB") with pytest.warns(DeprecationWarning): @@ -721,7 +720,5 @@ def test_deprecation() -> None: profile.product_name with pytest.warns(DeprecationWarning): profile.product_info - with pytest.warns(DeprecationWarning): - profile._set(p) with pytest.raises(AttributeError): profile.this_attribute_does_not_exist diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 29a7a62c2..2346a3bdc 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -193,15 +193,6 @@ Image.Image.get_child_images() method uses an image's file pointer, and so child images could only be retrieved from an :py:class:`PIL.ImageFile.ImageFile` instance. -ImageCms.ImageCmsProfile._set -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. deprecated:: 11.3.0 - -``ImageCms.ImageCmsProfile._set()`` has been deprecated, and will be removed in -Pillow 13 (2026-10-15). You should construct a new ``ImageCmsProfile`` instance -instead. - ImageCms.ImageCmsProfile.product_name and .product_info ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index cc1863995..22cf6ce7a 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -286,15 +286,6 @@ class ImageCmsProfile: msg = f"'{self.__class__.__name__}' has no attribute '{name}'" raise AttributeError(msg) - def _set(self, profile: core.CmsProfile, filename: str | None = None) -> None: - deprecate( - "ImageCmsProfile._set", - 13, - action="Set the 'profile' and 'filename' attributes directly instead.", - ) - self.profile = profile - self.filename = filename - def tobytes(self) -> bytes: """ Returns the profile in a format suitable for embedding in