Skip to content

Commit abbc890

Browse files
committed
Replaced OSError with more specific UnidentifiedImageError
1 parent 3e9068a commit abbc890

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Tests/test_file_jpeg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from io import BytesIO
44

55
import pytest
6-
from PIL import ExifTags, Image, ImageFile, JpegImagePlugin
6+
from PIL import ExifTags, Image, ImageFile, JpegImagePlugin, UnidentifiedImageError
77

88
from .helper import (
99
assert_image,
@@ -718,7 +718,7 @@ def read(n=-1):
718718
return res
719719

720720
buffer.read = read
721-
with pytest.raises(OSError):
721+
with pytest.raises(UnidentifiedImageError):
722722
Image.open(buffer)
723723

724724
# Assert the entire file has not been read

0 commit comments

Comments
 (0)