Commit 94c1c684 authored by Phil Schleihauf's avatar Phil Schleihauf

Raise ImportError instead of Exception for an import error

The issue at hand is in fact an error on import, and more specific exceptions are nicer to work with.
parent cb9f797c
...@@ -332,7 +332,7 @@ class ImageUploadField(FileUploadField): ...@@ -332,7 +332,7 @@ class ImageUploadField(FileUploadField):
""" """
# Check if PIL is installed # Check if PIL is installed
if Image is None: if Image is None:
raise Exception('PIL library was not found') raise ImportError('PIL library was not found')
self.max_size = max_size self.max_size = max_size
self.thumbnail_fn = thumbgen or thumbgen_filename self.thumbnail_fn = thumbgen or thumbgen_filename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment