mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Merge pull request #7720 from radarhere/type_hints_imt
This commit is contained in:
commit
4c5e2e4afd
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user