Removed ImageFile.raise_ioerror

This commit is contained in:
Andrew Murray 2021-10-18 10:53:16 +11:00
parent cd50d468ba
commit e444e7ab6d
4 changed files with 16 additions and 24 deletions

View File

@ -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)

View File

@ -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
~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -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.

View File

@ -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]