mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
OSError caused by decode error should use string argument to be in line with rest of module
This commit is contained in:
parent
22d50fd2c1
commit
036db2da87
|
@ -1146,7 +1146,7 @@ class TestFileLibTiff(LibTiffTestCase):
|
|||
im.load()
|
||||
|
||||
# Assert that the error code is IMAGING_CODEC_MEMORY
|
||||
assert str(e.value) == "-9"
|
||||
assert str(e.value) == "decoder error -9"
|
||||
|
||||
@pytest.mark.parametrize("compression", ("tiff_adobe_deflate", "jpeg"))
|
||||
def test_save_multistrip(self, compression: str, tmp_path: Path) -> None:
|
||||
|
|
|
@ -1406,7 +1406,8 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
self.fp = None # might be shared
|
||||
|
||||
if err < 0:
|
||||
raise OSError(err)
|
||||
msg = f"decoder error {err}"
|
||||
raise OSError(msg)
|
||||
|
||||
return Image.Image.load(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user