mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Combined duplicate lines
This commit is contained in:
parent
e0eb92ac0e
commit
e02f828358
|
@ -1494,14 +1494,13 @@ class Image(object):
|
|||
mode = getmodebase(self.mode) + "A"
|
||||
try:
|
||||
self.im.setmode(mode)
|
||||
self.pyaccess = None
|
||||
except (AttributeError, ValueError):
|
||||
# do things the hard way
|
||||
im = self.im.convert(mode)
|
||||
if im.mode not in ("LA", "RGBA"):
|
||||
raise ValueError # sanity check
|
||||
self.im = im
|
||||
self.pyaccess = None
|
||||
self.pyaccess = None
|
||||
self.mode = self.im.mode
|
||||
except (KeyError, ValueError):
|
||||
raise ValueError("illegal image mode")
|
||||
|
|
Loading…
Reference in New Issue
Block a user