Remove broken reference to Image.LoaderError

This exception has not existed since Willow 0.3. Type checking on the 'except' line only happens when an exception occurs, so most of the time this is harmless, but if an unrelated exception occurs here (such as that caused by a faulty filetype library: https://github.com/h2non/filetype.py/issues/130) the real exception gets masked by an AttributeError for the missing definition.
pull/9044/head
Matt Westcott 2022-08-30 15:07:49 +01:00 zatwierdzone przez Matt Westcott
rodzic 2414e50eb1
commit 9a9100e201
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -13,7 +13,7 @@ def has_jpeg_support():
with open(wagtail_jpg, "rb") as f:
try:
Image.open(f)
except (IOError, Image.LoaderError):
except IOError:
succeeded = False
return succeeded
@ -27,7 +27,7 @@ def has_png_support():
with open(wagtail_png, "rb") as f:
try:
Image.open(f)
except (IOError, Image.LoaderError):
except IOError:
succeeded = False
return succeeded