mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #6054: work around PIL's installation brokeness by detecting either of the two ways it can end up being installed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -467,7 +467,12 @@ class ImageField(FileField):
|
||||
f = super(ImageField, self).to_python(data)
|
||||
if f is None:
|
||||
return None
|
||||
from PIL import Image
|
||||
|
||||
# Try to import PIL in either of the two ways it can end up installed.
|
||||
try:
|
||||
from PIL import Image
|
||||
except ImportError:
|
||||
import Image
|
||||
|
||||
# We need to get a file object for PIL. We might have a path or we might
|
||||
# have to read the data into memory.
|
||||
|
||||
Reference in New Issue
Block a user