From e444e7ab6db84d552ee442c7e7723ab072ca28da Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 18 Oct 2021 10:53:16 +1100 Subject: [PATCH] Removed ImageFile.raise_ioerror --- Tests/test_imagefile.py | 6 ------ docs/deprecations.rst | 19 ++++++++++--------- docs/releasenotes/9.0.0.rst | 6 ++++++ src/PIL/ImageFile.py | 9 --------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index 892087916..f4e5a6a59 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -94,12 +94,6 @@ class TestImageFile: assert_image_equal(im1, im2) - def test_raise_ioerror(self): - with pytest.raises(IOError): - with pytest.warns(DeprecationWarning) as record: - ImageFile.raise_ioerror(1) - assert len(record) == 1 - def test_raise_oserror(self): with pytest.raises(OSError): ImageFile.raise_oserror(1) diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 812ed3194..004c2d51a 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -42,15 +42,6 @@ Image._showxv Use :py:meth:`.Image.Image.show` instead. If custom behaviour is required, use :py:func:`.ImageShow.register` to add a custom :py:class:`.ImageShow.Viewer` class. -ImageFile.raise_ioerror -~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 7.2.0 - -``IOError`` was merged into ``OSError`` in Python 3.3. -So, ``ImageFile.raise_ioerror`` will be removed in Pillow 9.0.0 (2022-01-02). -Use ``ImageFile.raise_oserror`` instead. - Tk/Tcl 8.4 ~~~~~~~~~~ @@ -98,6 +89,16 @@ Removed features Deprecated features are only removed in major releases after an appropriate period of deprecation has passed. +ImageFile.raise_ioerror +~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2.0 +.. versionremoved:: 9.0.0 + +``IOError`` was merged into ``OSError`` in Python 3.3. +So, ``ImageFile.raise_ioerror`` has been removed. +Use ``ImageFile.raise_oserror`` instead. + PILLOW_VERSION constant ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/releasenotes/9.0.0.rst b/docs/releasenotes/9.0.0.rst index e10287dca..9891fda39 100644 --- a/docs/releasenotes/9.0.0.rst +++ b/docs/releasenotes/9.0.0.rst @@ -8,3 +8,9 @@ PILLOW_VERSION constant ^^^^^^^^^^^^^^^^^^^^^^^ ``PILLOW_VERSION`` has been removed. Use ``__version__`` instead. + +ImageFile.raise_ioerror +~~~~~~~~~~~~~~~~~~~~~~~ + +``IOError`` was merged into ``OSError`` in Python 3.3. So, ``ImageFile.raise_ioerror`` +has been removed. Use ``ImageFile.raise_oserror`` instead. diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 43d2bf0cc..5ab53fa39 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -67,15 +67,6 @@ def raise_oserror(error): raise OSError(message + " when reading image file") -def raise_ioerror(error): - warnings.warn( - "raise_ioerror is deprecated and will be removed in Pillow 9 (2022-01-02). " - "Use raise_oserror instead.", - DeprecationWarning, - ) - return raise_oserror(error) - - def _tilesort(t): # sort on offset return t[2]