From 56d8b80a12e72ea358402bb47c08e93c1d31b621 Mon Sep 17 00:00:00 2001 From: Bryan Veloso Date: Thu, 13 Oct 2011 14:35:16 +0900 Subject: [PATCH] Future-proofing our PIL imports, fixes #37. --- imagekit/lib.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/imagekit/lib.py b/imagekit/lib.py index 06c0e4d..092cb5c 100644 --- a/imagekit/lib.py +++ b/imagekit/lib.py @@ -1,17 +1,13 @@ # Required PIL classes may or may not be available from the root namespace # depending on the installation method used. try: - import Image - import ImageFile - import ImageFilter - import ImageEnhance - import ImageColor + from PIL import Image, ImageColor, ImageEnhance, ImageFile, ImageFilter except ImportError: try: - from PIL import Image - from PIL import ImageFile - from PIL import ImageFilter - from PIL import ImageEnhance - from PIL import ImageColor + import Image + import ImageColor + import ImageEnhance + import ImageFile + import ImageFilter except ImportError: raise ImportError('ImageKit was unable to import the Python Imaging Library. Please confirm it`s installed and available on your current Python path.')