Skip to content

Commit

Permalink
Merge pull request #8694 from radarhere/exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Jan 14, 2025
2 parents bdfd881 + cf438c5 commit 84d58a0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Tests/oss-fuzz/test_fuzzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import packaging
import pytest

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

if sys.platform.startswith("win32"):
Expand All @@ -32,21 +32,17 @@ def test_fuzz_images(path: str) -> None:
fuzzers.fuzz_image(f.read())
assert True
except (
# Known exceptions from Pillow
OSError,
SyntaxError,
MemoryError,
ValueError,
NotImplementedError,
OverflowError,
):
# Known exceptions that are through from Pillow
assert True
except (
# Known Image.* exceptions
Image.DecompressionBombError,
Image.DecompressionBombWarning,
UnidentifiedImageError,
):
# Known Image.* exceptions
assert True
finally:
fuzzers.disable_decompressionbomb_error()
Expand Down

0 comments on commit 84d58a0

Please sign in to comment.