File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,11 @@ def test_safeblock(self):
9393
9494 assert_image_equal (im1 , im2 )
9595
96+ def test_raise_ioerror (self ):
97+ with pytest .raises (IOError ):
98+ with pytest .raises (DeprecationWarning ):
99+ ImageFile .raise_ioerror (1 )
100+
96101 def test_raise_oserror (self ):
97102 with pytest .raises (OSError ):
98103 ImageFile .raise_oserror (1 )
Original file line number Diff line number Diff line change 3030import io
3131import struct
3232import sys
33+ import warnings
3334
3435from . import Image
3536from ._util import isPath
@@ -64,6 +65,15 @@ def raise_oserror(error):
6465 raise OSError (message + " when reading image file" )
6566
6667
68+ def raise_ioerror (error ):
69+ warnings .warn (
70+ "raise_ioerror is deprecated and will be removed in a future release. "
71+ "Use raise_oserror instead." ,
72+ DeprecationWarning ,
73+ )
74+ return raise_oserror (error )
75+
76+
6777def _tilesort (t ):
6878 # sort on offset
6979 return t [2 ]
You can’t perform that action at this time.
0 commit comments