Skip to content

Commit e444e7a

Browse files
committed
Removed ImageFile.raise_ioerror
1 parent cd50d46 commit e444e7a

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

Tests/test_imagefile.py

-6
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ def test_safeblock(self):
9494

9595
assert_image_equal(im1, im2)
9696

97-
def test_raise_ioerror(self):
98-
with pytest.raises(IOError):
99-
with pytest.warns(DeprecationWarning) as record:
100-
ImageFile.raise_ioerror(1)
101-
assert len(record) == 1
102-
10397
def test_raise_oserror(self):
10498
with pytest.raises(OSError):
10599
ImageFile.raise_oserror(1)

docs/deprecations.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ Image._showxv
4242
Use :py:meth:`.Image.Image.show` instead. If custom behaviour is required, use
4343
:py:func:`.ImageShow.register` to add a custom :py:class:`.ImageShow.Viewer` class.
4444

45-
ImageFile.raise_ioerror
46-
~~~~~~~~~~~~~~~~~~~~~~~
47-
48-
.. deprecated:: 7.2.0
49-
50-
``IOError`` was merged into ``OSError`` in Python 3.3.
51-
So, ``ImageFile.raise_ioerror`` will be removed in Pillow 9.0.0 (2022-01-02).
52-
Use ``ImageFile.raise_oserror`` instead.
53-
5445
Tk/Tcl 8.4
5546
~~~~~~~~~~
5647

@@ -98,6 +89,16 @@ Removed features
9889
Deprecated features are only removed in major releases after an appropriate
9990
period of deprecation has passed.
10091

92+
ImageFile.raise_ioerror
93+
~~~~~~~~~~~~~~~~~~~~~~~
94+
95+
.. deprecated:: 7.2.0
96+
.. versionremoved:: 9.0.0
97+
98+
``IOError`` was merged into ``OSError`` in Python 3.3.
99+
So, ``ImageFile.raise_ioerror`` has been removed.
100+
Use ``ImageFile.raise_oserror`` instead.
101+
101102
PILLOW_VERSION constant
102103
~~~~~~~~~~~~~~~~~~~~~~~
103104

docs/releasenotes/9.0.0.rst

+6
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ PILLOW_VERSION constant
88
^^^^^^^^^^^^^^^^^^^^^^^
99

1010
``PILLOW_VERSION`` has been removed. Use ``__version__`` instead.
11+
12+
ImageFile.raise_ioerror
13+
~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
``IOError`` was merged into ``OSError`` in Python 3.3. So, ``ImageFile.raise_ioerror``
16+
has been removed. Use ``ImageFile.raise_oserror`` instead.

src/PIL/ImageFile.py

-9
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ def raise_oserror(error):
6767
raise OSError(message + " when reading image file")
6868

6969

70-
def raise_ioerror(error):
71-
warnings.warn(
72-
"raise_ioerror is deprecated and will be removed in Pillow 9 (2022-01-02). "
73-
"Use raise_oserror instead.",
74-
DeprecationWarning,
75-
)
76-
return raise_oserror(error)
77-
78-
7970
def _tilesort(t):
8071
# sort on offset
8172
return t[2]

0 commit comments

Comments
 (0)