mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 21:17:02 +03:00
Assert fp is not None
This commit is contained in:
parent
476b122ae4
commit
bf18e5fe8b
|
@ -26,6 +26,7 @@ def test_invalid_file() -> None:
|
||||||
no_cursors_file = "Tests/images/no_cursors.cur"
|
no_cursors_file = "Tests/images/no_cursors.cur"
|
||||||
|
|
||||||
cur = CurImagePlugin.CurImageFile(TEST_FILE)
|
cur = CurImagePlugin.CurImageFile(TEST_FILE)
|
||||||
|
assert cur.fp is not None
|
||||||
cur.fp.close()
|
cur.fp.close()
|
||||||
with open(no_cursors_file, "rb") as cur.fp:
|
with open(no_cursors_file, "rb") as cur.fp:
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
|
|
|
@ -38,6 +38,7 @@ class CurImageFile(BmpImagePlugin.BmpImageFile):
|
||||||
format_description = "Windows Cursor"
|
format_description = "Windows Cursor"
|
||||||
|
|
||||||
def _open(self) -> None:
|
def _open(self) -> None:
|
||||||
|
assert self.fp is not None
|
||||||
offset = self.fp.tell()
|
offset = self.fp.tell()
|
||||||
|
|
||||||
# check magic
|
# check magic
|
||||||
|
|
Loading…
Reference in New Issue
Block a user