Skip to content

Commit

Permalink
Merge pull request #5090 from radarhere/valueerror
Browse files Browse the repository at this point in the history
Do not catch a ValueError only to raise another
  • Loading branch information
hugovk committed Dec 29, 2020
2 parents 25500e8 + ff0ad9a commit 5c64438
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Expand Up @@ -1634,7 +1634,7 @@ def putalpha(self, alpha):
self.im = im
self.pyaccess = None
self.mode = self.im.mode
except (KeyError, ValueError) as e:
except KeyError as e:
raise ValueError("illegal image mode") from e

if self.mode in ("LA", "PA"):
Expand Down

0 comments on commit 5c64438

Please sign in to comment.