Skip to content

Commit 408cec4

Browse files
committed
Correct type when using PngStream with a context manager
1 parent f82a816 commit 408cec4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/PIL/PngImagePlugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ def __init__(self, fp: IO[bytes]) -> None:
400400

401401
self.text_memory = 0
402402

403+
def __enter__(self) -> PngStream:
404+
return self
405+
403406
def check_text_memory(self, chunklen: int) -> None:
404407
self.text_memory += chunklen
405408
if self.text_memory > MAX_TEXT_MEMORY:

0 commit comments

Comments
 (0)