Skip to content

Commit

Permalink
Do not catch a ValueError only to raise another
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 12, 2020
1 parent 4ed79ea commit ff0ad9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Expand Up @@ -1626,7 +1626,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 ff0ad9a

Please sign in to comment.