Skip to content

Commit 2ebfe30

Browse files
authored
Added return type to ImageFile _close_fp() (#9356)
1 parent 19910ed commit 2ebfe30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PIL/ImageFile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def __init__(
131131
self.decoderconfig: tuple[Any, ...] = ()
132132
self.decodermaxblock = MAXBLOCK
133133

134+
self._fp: IO[bytes] | DeferredError
134135
if is_path(fp):
135136
# filename
136137
self.fp = open(fp, "rb")
@@ -167,7 +168,7 @@ def __init__(
167168
def _open(self) -> None:
168169
pass
169170

170-
def _close_fp(self):
171+
def _close_fp(self) -> None:
171172
if getattr(self, "_fp", False) and not isinstance(self._fp, DeferredError):
172173
if self._fp != self.fp:
173174
self._fp.close()

0 commit comments

Comments
 (0)