Added type hints

This commit is contained in:
Andrew Murray 2024-01-15 20:04:51 +11:00
parent ed9e29d31e
commit 4a6cb0f844

View File

@ -33,10 +33,12 @@ class ImtImageFile(ImageFile.ImageFile):
format = "IMT" format = "IMT"
format_description = "IM Tools" format_description = "IM Tools"
def _open(self): def _open(self) -> None:
# Quick rejection: if there's not a LF among the first # Quick rejection: if there's not a LF among the first
# 100 bytes, this is (probably) not a text header. # 100 bytes, this is (probably) not a text header.
assert self.fp is not None
buffer = self.fp.read(100) buffer = self.fp.read(100)
if b"\n" not in buffer: if b"\n" not in buffer:
msg = "not an IM file" msg = "not an IM file"