Skip to content

Commit 5c64438

Browse files
authored
Merge pull request #5090 from radarhere/valueerror
Do not catch a ValueError only to raise another
2 parents 25500e8 + ff0ad9a commit 5c64438

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PIL/Image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ def putalpha(self, alpha):
16341634
self.im = im
16351635
self.pyaccess = None
16361636
self.mode = self.im.mode
1637-
except (KeyError, ValueError) as e:
1637+
except KeyError as e:
16381638
raise ValueError("illegal image mode") from e
16391639

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

0 commit comments

Comments
 (0)