Fixed #8187: made PIL imports consistant. Thanks, bastih.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6a06db0491
commit
750f5c8d46
|
@ -75,7 +75,7 @@ class ImageFile(models.Model):
|
||||||
# Checking for the existence of Image is enough for CPython, but
|
# Checking for the existence of Image is enough for CPython, but
|
||||||
# for PyPy, you need to check for the underlying modules
|
# for PyPy, you need to check for the underlying modules
|
||||||
# If PIL is not available, this test is equivalent to TextFile above.
|
# If PIL is not available, this test is equivalent to TextFile above.
|
||||||
import Image, _imaging
|
from PIL import Image, _imaging
|
||||||
image = models.ImageField(storage=temp_storage, upload_to='tests')
|
image = models.ImageField(storage=temp_storage, upload_to='tests')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
image = models.FileField(storage=temp_storage, upload_to='tests')
|
image = models.FileField(storage=temp_storage, upload_to='tests')
|
||||||
|
|
|
@ -12,7 +12,7 @@ temp_storage = FileSystemStorage(tempfile.gettempdir())
|
||||||
try:
|
try:
|
||||||
# Checking for the existence of Image is enough for CPython, but
|
# Checking for the existence of Image is enough for CPython, but
|
||||||
# for PyPy, you need to check for the underlying modules
|
# for PyPy, you need to check for the underlying modules
|
||||||
import Image, _imaging
|
from PIL import Image, _imaging
|
||||||
except ImportError:
|
except ImportError:
|
||||||
Image = None
|
Image = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue