Merge pull request #5090 from radarhere/valueerror

Do not catch a ValueError only to raise another
This commit is contained in:
Hugo van Kemenade 2020-12-29 12:19:16 +02:00 committed by GitHub
commit 5c64438792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1634,7 +1634,7 @@ class Image:
self.im = im self.im = im
self.pyaccess = None self.pyaccess = None
self.mode = self.im.mode self.mode = self.im.mode
except (KeyError, ValueError) as e: except KeyError as e:
raise ValueError("illegal image mode") from e raise ValueError("illegal image mode") from e
if self.mode in ("LA", "PA"): if self.mode in ("LA", "PA"):