diff options
author | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-14 19:31:16 -0700 |
---|---|---|
committer | Daniel Lindsley <daniel@toastdriven.com> | 2013-05-14 19:32:04 -0700 |
commit | 33793f7c3edd8ff144ff2e9434367267c20af26a (patch) | |
tree | 2fc05d98ee3d9c2bb9fd9a208647ad280d52b78c /tests/model_forms/models.py | |
parent | c792c83cad54f064b6ba13e285e95a90e2c61f09 (diff) | |
download | django-33793f7c3edd8ff144ff2e9434367267c20af26a.tar.gz |
Fixed #19934 - Use of Pillow is now preferred over PIL.
This starts the deprecation period for PIL (support to end in 1.8).
Diffstat (limited to 'tests/model_forms/models.py')
-rw-r--r-- | tests/model_forms/models.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py index 25c780f1c2..a79d9b8c5b 100644 --- a/tests/model_forms/models.py +++ b/tests/model_forms/models.py @@ -11,6 +11,7 @@ from __future__ import unicode_literals import os import tempfile +from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import FileSystemStorage from django.db import models from django.utils import six @@ -91,14 +92,7 @@ class TextFile(models.Model): return self.description try: - # If PIL is available, try testing ImageFields. Checking for the existence - # of Image is enough for CPython, but for PyPy, you need to check for the - # underlying modules If PIL is not available, ImageField tests are omitted. - # Try to import PIL in either of the two ways it can end up installed. - try: - from PIL import Image, _imaging - except ImportError: - import Image, _imaging + from django.utils.image import Image test_images = True @@ -137,7 +131,7 @@ try: def __str__(self): return self.description -except ImportError: +except ImproperlyConfigured: test_images = False @python_2_unicode_compatible |