Skip to content

Commit

Permalink
Merge pull request #7720 from radarhere/type_hints_imt
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 16, 2024
2 parents ab1de6d + 4a6cb0f commit 4c5e2e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PIL/ImtImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ class ImtImageFile(ImageFile.ImageFile):
format = "IMT"
format_description = "IM Tools"

def _open(self):
def _open(self) -> None:
# Quick rejection: if there's not a LF among the first
# 100 bytes, this is (probably) not a text header.

assert self.fp is not None

buffer = self.fp.read(100)
if b"\n" not in buffer:
msg = "not an IM file"
Expand Down

0 comments on commit 4c5e2e4

Please sign in to comment.