diff options
Diffstat (limited to 'rest_framework/fields.py')
| -rw-r--r-- | rest_framework/fields.py | 7 | 
1 files changed, 2 insertions, 5 deletions
| diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 82745973..75ce1b9f 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1056,11 +1056,8 @@ class ImageField(FileField):          if f is None:              return None -        # Try to import PIL in either of the two ways it can end up installed. -        try: -            from PIL import Image -        except ImportError: -            import Image +        from compat import Image +        assert Image is not None, 'PIL must be installed for ImageField support'          # We need to get a file object for PIL. We might have a path or we might          # have to read the data into memory. | 
