diff --git a/Tests/test_file_mic.py b/Tests/test_file_mic.py index 4cd376188f3..9424bcf0893 100644 --- a/Tests/test_file_mic.py +++ b/Tests/test_file_mic.py @@ -2,7 +2,6 @@ from io import BytesIO -import olefile import pytest from PIL import Image, ImagePalette @@ -101,6 +100,8 @@ def test_seek_size_change() -> None: def test_seek_decompression_bomb(tmp_path: Path) -> None: + import olefile + with Image.open(TEST_FILE) as im: assert isinstance(im, MicImagePlugin.MicImageFile) im._n_frames = 2 diff --git a/src/PIL/FpxImagePlugin.py b/src/PIL/FpxImagePlugin.py index 16eb3a9d3b7..6da46c17bee 100644 --- a/src/PIL/FpxImagePlugin.py +++ b/src/PIL/FpxImagePlugin.py @@ -16,7 +16,7 @@ # from __future__ import annotations -__lazy_modules__ = {"PIL._binary", "olefile"} +__lazy_modules__ = {"PIL._binary"} import olefile diff --git a/src/PIL/MicImagePlugin.py b/src/PIL/MicImagePlugin.py index 76a2c9b4975..9d92297115b 100644 --- a/src/PIL/MicImagePlugin.py +++ b/src/PIL/MicImagePlugin.py @@ -17,8 +17,6 @@ # from __future__ import annotations -__lazy_modules__ = {"olefile"} - import olefile from . import Image, TiffImagePlugin