We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ResourceWarning
selftest.py
2 parents 6d493aa + 7653280 commit 374957cCopy full SHA for 374957c
selftest.py
@@ -40,12 +40,14 @@ def testimage() -> None:
40
>>> with Image.open("Tests/images/hopper.gif") as im:
41
... _info(im)
42
('GIF', 'P', (128, 128))
43
- >>> _info(Image.open("Tests/images/hopper.ppm"))
+ >>> with Image.open("Tests/images/hopper.ppm") as im:
44
+ ... _info(im)
45
('PPM', 'RGB', (128, 128))
46
>>> try:
- ... _info(Image.open("Tests/images/hopper.jpg"))
47
+ ... with Image.open("Tests/images/hopper.jpg") as im:
48
49
... except OSError as v:
- ... print(v)
50
+ ... print(v)
51
('JPEG', 'RGB', (128, 128))
52
53
PIL doesn't actually load the image data until it's needed,
0 commit comments