diff --git a/Tests/test_image.py b/Tests/test_image.py index 17f1edb00..cb31565e7 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -929,17 +929,6 @@ class TestImage: im.apply_transparency() assert im.palette.colors[(27, 35, 6, 214)] == 24 - def test_categories_deprecation(self): - with pytest.warns(DeprecationWarning): - assert hopper().category == 0 - - with pytest.warns(DeprecationWarning): - assert Image.NORMAL == 0 - with pytest.warns(DeprecationWarning): - assert Image.SEQUENCE == 1 - with pytest.warns(DeprecationWarning): - assert Image.CONTAINER == 2 - def test_constants(self): with pytest.warns(DeprecationWarning): assert Image.LINEAR == Image.Resampling.BILINEAR diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 47d1531ae..1e448ad31 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -12,18 +12,6 @@ Deprecated features Below are features which are considered deprecated. Where appropriate, a ``DeprecationWarning`` is issued. -Categories -~~~~~~~~~~ - -.. deprecated:: 8.2.0 - -``im.category`` is deprecated and will be removed in Pillow 10.0.0 (2023-07-01), -along with the related ``Image.NORMAL``, ``Image.SEQUENCE`` and -``Image.CONTAINER`` attributes. - -To determine if an image has multiple frames or not, -``getattr(im, "is_animated", False)`` can be used instead. - JpegImagePlugin.convert_dict_qtables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -210,6 +198,18 @@ Tk/Tcl 8.4 Support for Tk/Tcl 8.4 was removed in Pillow 10.0.0 (2023-07-01). +Categories +~~~~~~~~~~ + +.. deprecated:: 8.2.0 +.. versionremoved:: 10.0.0 + +``im.category`` was removed along with the related ``Image.NORMAL``, +``Image.SEQUENCE`` and ``Image.CONTAINER`` attributes. + +To determine if an image has multiple frames or not, +``getattr(im, "is_animated", False)`` can be used instead. + PyQt5 and PySide2 ~~~~~~~~~~~~~~~~~ diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 4a142a008..99a895fb0 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -61,10 +61,6 @@ from ._util import DeferredError, is_path def __getattr__(name): - categories = {"NORMAL": 0, "SEQUENCE": 1, "CONTAINER": 2} - if name in categories: - deprecate("Image categories", 10, "is_animated", plural=True) - return categories[name] old_resampling = { "LINEAR": "BILINEAR", "CUBIC": "BICUBIC", @@ -521,12 +517,6 @@ class Image: self.pyaccess = None self._exif = None - def __getattr__(self, name): - if name == "category": - deprecate("Image categories", 10, "is_animated", plural=True) - return self._category - raise AttributeError(name) - @property def width(self): return self.size[0]