Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UnidentifiedImageError and __version__ imports #7644

Merged
merged 3 commits into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/oss-fuzz/test_fuzzers.py
Expand Up @@ -7,7 +7,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 @@ -43,7 +43,7 @@ def test_fuzz_images(path: str) -> None:
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
Expand Up @@ -5,7 +5,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 @@ -419,7 +419,7 @@ def test_emptyline() -> None:
)
def test_timeout(test_file: str) -> None:
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
Expand Up @@ -4,7 +4,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 @@ -152,11 +152,11 @@ def test_combined_larger_than_size() -> None:
[
(
"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
4 changes: 2 additions & 2 deletions src/PIL/ImageCms.py
Expand Up @@ -25,7 +25,7 @@
from functools import reduce
from typing import Any

from . import Image
from . import Image, __version__
from ._deprecate import deprecate

try:
Expand Down Expand Up @@ -1087,4 +1087,4 @@ def versions():
12,
'(PIL.features.version("littlecms2"), sys.version, PIL.__version__)',
)
return _VERSION, core.littlecms_version, sys.version.split()[0], Image.__version__
return _VERSION, core.littlecms_version, sys.version.split()[0], __version__