From 30eb41475dacea619c4660555788ec73d32df2a9 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 1 Dec 2023 22:44:51 +1100 Subject: [PATCH] Use f-string Co-authored-by: Aarni Koskela --- src/PIL/DdsImagePlugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/PIL/DdsImagePlugin.py b/src/PIL/DdsImagePlugin.py index 65d9deaa0..731c85a7e 100644 --- a/src/PIL/DdsImagePlugin.py +++ b/src/PIL/DdsImagePlugin.py @@ -154,9 +154,7 @@ class DdsImageFile(ImageFile.ImageFile): self._mode = "RGB" mask_count = 3 - masks = struct.unpack( - "<" + str(mask_count) + "I", header.read(mask_count * 4) - ) + masks = struct.unpack(f"<{mask_count}I", header.read(mask_count * 4)) self.tile = [("dds_rgb", (0, 0) + self.size, 0, (bitcount, masks))] elif pfflags & DDPF_PALETTEINDEXED8: self._mode = "P"