diff --git a/src/PIL/DdsImagePlugin.py b/src/PIL/DdsImagePlugin.py index 7367be169..ad86ff976 100644 --- a/src/PIL/DdsImagePlugin.py +++ b/src/PIL/DdsImagePlugin.py @@ -12,7 +12,6 @@ Full text of the CC0 license: import io import struct from enum import IntEnum, IntFlag -from io import BytesIO from . import Image, ImageFile from ._binary import i32le as i32 @@ -286,7 +285,7 @@ class DdsImageFile(ImageFile.ImageFile): if len(header_bytes) != 120: msg = f"Incomplete header: {len(header_bytes)} bytes" raise OSError(msg) - header = BytesIO(header_bytes) + header = io.BytesIO(header_bytes) flags_, height, width = struct.unpack("<3I", header.read(12)) flags = DDSD(flags_)