mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 12:44:46 +03:00
Add filename to OSError.
This commit is contained in:
parent
186145e5a0
commit
c3373e928c
|
@ -240,7 +240,8 @@ class ImageFile(Image.Image):
|
||||||
if LOAD_TRUNCATED_IMAGES:
|
if LOAD_TRUNCATED_IMAGES:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise OSError("image file is truncated") from e
|
raise OSError(None, "image file is truncated",
|
||||||
|
self.filename) from e
|
||||||
|
|
||||||
if not s: # truncated jpeg
|
if not s: # truncated jpeg
|
||||||
if LOAD_TRUNCATED_IMAGES:
|
if LOAD_TRUNCATED_IMAGES:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user