Corrected TypeError in Python 3

This commit is contained in:
Andrew Murray 2018-11-13 21:45:52 +11:00
parent e3d5494a51
commit 9a1c3915ae
2 changed files with 5 additions and 3 deletions

View File

@ -36,7 +36,7 @@ class TestPngDos(PillowTestCase):
def test_dos_total_memory(self):
im = Image.new('L', (1, 1))
compressed_data = zlib.compress('a'*1024*1023)
compressed_data = zlib.compress(b'a'*1024*1023)
info = PngImagePlugin.PngInfo()

View File

@ -10,7 +10,9 @@ if __name__ == "__main__":
print(" f._load_pilfont_data(")
print(" # %s" % os.path.basename(font))
print(" BytesIO(base64.decodestring(b'''")
base64.encode(open(font + ".pil", "rb"), sys.stdout)
with open(font + ".pil", "rb") as fp:
print(base64.b64encode(fp.read()).decode())
print("''')), Image.open(BytesIO(base64.decodestring(b'''")
base64.encode(open(font + ".pbm", "rb"), sys.stdout)
with open(font + ".pbm", "rb") as fp:
print(base64.b64encode(fp.read()).decode())
print("'''))))")