Typing: Ignore py2/py3 differences

This commit is contained in:
Eric Soroos 2018-01-05 10:27:05 +00:00
parent 02e10805e0
commit 3ee774ede0

View File

@ -1324,7 +1324,7 @@ class Image(object):
if bytes is str: if bytes is str:
return [i8(c) for c in self.im.getpalette()] return [i8(c) for c in self.im.getpalette()]
else: else:
return list(self.im.getpalette()) return list(self.im.getpalette()) # type: ignore
except ValueError: except ValueError:
return None # no palette return None # no palette
@ -1688,7 +1688,7 @@ class Image(object):
else: else:
if not isinstance(data, bytes): if not isinstance(data, bytes):
if bytes is str: if bytes is str:
data = "".join(chr(x) for x in data) data = "".join(chr(x) for x in data) # type: ignore
else: else:
data = bytes(data) data = bytes(data)
palette = ImagePalette.raw(rawmode, data) palette = ImagePalette.raw(rawmode, data)