Do not catch a ValueError only to raise another

This commit is contained in:
Andrew Murray 2020-12-12 23:36:57 +11:00
parent 4ed79ea79c
commit ff0ad9af34

View File

@ -1626,7 +1626,7 @@ class Image:
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"):