Removed ImageCms._set

This commit is contained in:
Andrew Murray 2025-06-16 18:41:00 +10:00
parent f76f64a187
commit 7713df961d
3 changed files with 1 additions and 22 deletions

View File

@ -710,8 +710,7 @@ def test_deprecation() -> None:
with pytest.warns(DeprecationWarning): with pytest.warns(DeprecationWarning):
assert isinstance(ImageCms.FLAGS, dict) assert isinstance(ImageCms.FLAGS, dict)
p = ImageCms.createProfile("sRGB") profile = ImageCmsProfile(ImageCms.createProfile("sRGB"))
profile = ImageCmsProfile(p)
with pytest.warns(DeprecationWarning): with pytest.warns(DeprecationWarning):
ImageCms.ImageCmsTransform(profile, profile, "RGBA;16B", "RGB") ImageCms.ImageCmsTransform(profile, profile, "RGBA;16B", "RGB")
with pytest.warns(DeprecationWarning): with pytest.warns(DeprecationWarning):
@ -721,7 +720,5 @@ def test_deprecation() -> None:
profile.product_name profile.product_name
with pytest.warns(DeprecationWarning): with pytest.warns(DeprecationWarning):
profile.product_info profile.product_info
with pytest.warns(DeprecationWarning):
profile._set(p)
with pytest.raises(AttributeError): with pytest.raises(AttributeError):
profile.this_attribute_does_not_exist profile.this_attribute_does_not_exist

View File

@ -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 method uses an image's file pointer, and so child images could only be retrieved from
an :py:class:`PIL.ImageFile.ImageFile` instance. 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 ImageCms.ImageCmsProfile.product_name and .product_info
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -286,15 +286,6 @@ class ImageCmsProfile:
msg = f"'{self.__class__.__name__}' has no attribute '{name}'" msg = f"'{self.__class__.__name__}' has no attribute '{name}'"
raise AttributeError(msg) 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: def tobytes(self) -> bytes:
""" """
Returns the profile in a format suitable for embedding in Returns the profile in a format suitable for embedding in