From 97b23af7e51b56783a5fc7f384164e2e657d49e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Cuenca=20Abela?= Date: Tue, 4 Feb 2014 17:23:29 +0100 Subject: [PATCH] Try to fix test_file_jpeg in Python3 --- Tests/test_file_jpeg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py index 4bb6f1e92..ef974cfe7 100644 --- a/Tests/test_file_jpeg.py +++ b/Tests/test_file_jpeg.py @@ -1,6 +1,5 @@ from tester import * -import array import random from PIL import Image @@ -137,8 +136,7 @@ def test_progressive_large_buffer(): def test_progressive_large_buffer_highest_quality(): f = tempfile('temp.jpg') - a = array.array('B') - a.extend(random.randint(0, 255) for _ in range(256 * 256 * 3)) + a = b''.join(chr(random.randint(0, 255)) for _ in range(256 * 256 * 3)) im = Image.frombuffer("RGB", (256, 256), a, "raw", "RGB", 0, 1) # this requires more bytes than pixels in the image im.save(f, format="JPEG", progressive=True, quality=100)