mirror of
https://github.com/django/django.git
synced 2025-09-08 03:30:48 +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:
parent
e6740cb39c
commit
7578981626
6 changed files with 41 additions and 14 deletions
|
@ -6,12 +6,17 @@ try:
|
|||
except ImportError:
|
||||
from django.utils import _decimal as decimal # Python 2.3 fallback
|
||||
|
||||
# Try to import PIL in either of the two ways it can end up installed.
|
||||
# Checking for the existence of Image is enough for CPython, but for PyPy,
|
||||
# you need to check for the underlying modules.
|
||||
|
||||
try:
|
||||
# Checking for the existence of Image is enough for CPython, but for PyPy,
|
||||
# you need to check for the underlying modules.
|
||||
from PIL import Image, _imaging
|
||||
except ImportError:
|
||||
Image = None
|
||||
try:
|
||||
import Image, _imaging
|
||||
except ImportError:
|
||||
Image = None
|
||||
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.db import models
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue