Merge pull request #2714 from radarhere/pyaccess

Removed unnecessary lines
This commit is contained in:
wiredfool 2017-09-09 10:18:42 +01:00 committed by GitHub
commit 81b7a943ac

View File

@ -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")
@ -1602,7 +1601,6 @@ class Image(object):
self.load()
if self.readonly:
self._copy()
self.pyaccess = None
self.load()
if self.pyaccess: