mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 13:07:00 +03:00
Assert fp is not None
This commit is contained in:
parent
e73b5ff4cd
commit
a529797857
|
@ -48,6 +48,7 @@ class FliImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
def _open(self) -> None:
|
def _open(self) -> None:
|
||||||
# HEAD
|
# HEAD
|
||||||
|
assert self.fp is not None
|
||||||
s = self.fp.read(128)
|
s = self.fp.read(128)
|
||||||
if not (_accept(s) and s[20:22] == b"\x00\x00"):
|
if not (_accept(s) and s[20:22] == b"\x00\x00"):
|
||||||
msg = "not an FLI/FLC file"
|
msg = "not an FLI/FLC file"
|
||||||
|
@ -110,6 +111,7 @@ class FliImageFile(ImageFile.ImageFile):
|
||||||
# load palette
|
# load palette
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
assert self.fp is not None
|
||||||
for e in range(i16(self.fp.read(2))):
|
for e in range(i16(self.fp.read(2))):
|
||||||
s = self.fp.read(2)
|
s = self.fp.read(2)
|
||||||
i = i + s[0]
|
i = i + s[0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user