From c859e3bf40617969f2e820c3dfeab9be4c51b947 Mon Sep 17 00:00:00 2001 From: hugovk Date: Thu, 27 Nov 2014 21:43:45 +0200 Subject: [PATCH] Some landscape.io fixes --- PIL/ImageOps.py | 1 - PIL/ImageQt.py | 12 ++++++------ Tests/test_box_blur.py | 6 ++++++ Tests/test_file_gif.py | 6 +++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/PIL/ImageOps.py b/PIL/ImageOps.py index 30377dc62..a1706875d 100644 --- a/PIL/ImageOps.py +++ b/PIL/ImageOps.py @@ -20,7 +20,6 @@ from PIL import Image from PIL._util import isStringType import operator -import math from functools import reduce diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index 35c8d5833..22ee2ea8f 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -21,16 +21,16 @@ from PIL._util import isPath import sys if 'PyQt4.QtGui' not in sys.modules: - try: - from PyQt5.QtGui import QImage, qRgba - except: try: - from PyQt4.QtGui import QImage, qRgba + from PyQt5.QtGui import QImage, qRgba except: - from PySide.QtGui import QImage, qRgba + try: + from PyQt4.QtGui import QImage, qRgba + except: + from PySide.QtGui import QImage, qRgba else: #PyQt4 is used - from PyQt4.QtGui import QImage, qRgba + from PyQt4.QtGui import QImage, qRgba ## # (Internal) Turns an RGB color into a Qt compatible color integer. diff --git a/Tests/test_box_blur.py b/Tests/test_box_blur.py index 17fd0bac1..8c52054a2 100644 --- a/Tests/test_box_blur.py +++ b/Tests/test_box_blur.py @@ -227,3 +227,9 @@ class TestBoxBlur(PillowTestCase): passes=3, delta=1, ) + + +if __name__ == '__main__': + unittest.main() + +# End of file diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 57cd71ac6..1046c166d 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -30,9 +30,9 @@ class TestFileGif(PillowTestCase): def test_grayscale(optimize): im = Image.new("L", (1, 1), 0) - file = BytesIO() - im.save(file, "GIF", optimize=optimize) - return len(file.getvalue()) + filename = BytesIO() + im.save(filename, "GIF", optimize=optimize) + return len(filename.getvalue()) def test_bilevel(optimize): im = Image.new("1", (1, 1), 0)