Skip to content

Commit

Permalink
Import UnidentifiedImageError directly
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 27, 2023
1 parent 1e8bad8 commit f6f3dab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Tests/oss-fuzz/test_fuzzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import packaging
import pytest

from PIL import Image, features
from PIL import Image, UnidentifiedImageError, features
from Tests.helper import skip_unless_feature

if sys.platform.startswith("win32"):
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_fuzz_images(path):
except (
Image.DecompressionBombError,
Image.DecompressionBombWarning,
Image.UnidentifiedImageError,
UnidentifiedImageError,
):
# Known Image.* exceptions
assert True
Expand Down
4 changes: 2 additions & 2 deletions Tests/test_file_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from PIL import EpsImagePlugin, Image, features
from PIL import EpsImagePlugin, Image, UnidentifiedImageError, features

from .helper import (
assert_image_similar,
Expand Down Expand Up @@ -417,7 +417,7 @@ def test_emptyline():
)
def test_timeout(test_file):
with open(test_file, "rb") as f:
with pytest.raises(Image.UnidentifiedImageError):
with pytest.raises(UnidentifiedImageError):
with Image.open(f):
pass

Expand Down
6 changes: 3 additions & 3 deletions Tests/test_file_psd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from PIL import Image, PsdImagePlugin
from PIL import Image, PsdImagePlugin, UnidentifiedImageError

from .helper import assert_image_equal_tofile, assert_image_similar, hopper, is_pypy

Expand Down Expand Up @@ -146,11 +146,11 @@ def test_combined_larger_than_size():
[
(
"Tests/images/timeout-1ee28a249896e05b83840ae8140622de8e648ba9.psd",
Image.UnidentifiedImageError,
UnidentifiedImageError,
),
(
"Tests/images/timeout-598843abc37fc080ec36a2699ebbd44f795d3a6f.psd",
Image.UnidentifiedImageError,
UnidentifiedImageError,
),
("Tests/images/timeout-c8efc3fded6426986ba867a399791bae544f59bc.psd", OSError),
("Tests/images/timeout-dedc7a4ebd856d79b4359bbcc79e8ef231ce38f6.psd", OSError),
Expand Down

0 comments on commit f6f3dab

Please sign in to comment.