Skip to content

Commit

Permalink
Added type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 15, 2024
1 parent ed9e29d commit 4a6cb0f
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 4a6cb0f

Please sign in to comment.